Skip to content

Instantly share code, notes, and snippets.

@danudey
Created February 23, 2015 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danudey/7e7679bfe129ef88d914 to your computer and use it in GitHub Desktop.
Save danudey/7e7679bfe129ef88d914 to your computer and use it in GitHub Desktop.
Debian/Ubuntu repository rebuilder
#!/usr/bin/make -s
PACKAGES_FILES := dists/trusty/extras/binary-amd64/Packages dists/trusty/extras/binary-amd64/Packages.gz
all : packages release
packages : $(PACKAGES_FILES)
release : dists/trusty/Release
dists/trusty/extras/binary-amd64/Packages : pool/extras/*deb
@echo "*** Debian packages changed, rebuilding packages index"
@apt-ftparchive --db=tmp/apt-ftparchive-packages.bdb packages pool/extras > dists/trusty/extras/binary-amd64/Packages
dists/trusty/extras/binary-amd64/Packages.gz : dists/trusty/extras/binary-amd64/Packages
@echo "*** Packages index changed, gzipping"
@gzip < dists/trusty/extras/binary-amd64/Packages > dists/trusty/extras/binary-amd64/Packages.gz
dists/trusty/Release : $(PACKAGES_FILES)
@echo "*** Packages index changed, rebuilding release"
@$(RM) dists/trusty/Release
@apt-ftparchive release dists/trusty \
-o APT::FTPArchive::Release::Origin=Ubuntu \
-o APT::FTPArchive::Release::Label=Ubuntu \
-o APT::FTPArchive::Release::Suite=trusty \
-o APT::FTPArchive::Release::Version=14.04 \
-o APT::FTPArchive::Release::Codename=trusty \
-o APT::FTPArchive::Release::Architectures=amd64 \
-o APT::FTPArchive::Release::Components="main extras" \
-o APT::FTPArchive::Release::Description="Ubuntu 14.04 Netboot" > dists/trusty/Release
clean :
$(RM) dists/trusty/extras/binary-amd64/Packages dists/trusty/extras/binary-amd64/Packages.gz
$(RM) dists/trusty/Release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment