Skip to content

Instantly share code, notes, and snippets.

@msvalina
Created September 16, 2019 08:28
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 msvalina/d7090df6c8c136638cdee1fc2c258352 to your computer and use it in GitHub Desktop.
Save msvalina/d7090df6c8c136638cdee1fc2c258352 to your computer and use it in GitHub Desktop.
all: build-package build-index
VERSION:=$(shell grep "^Version: " control | cut -d":" -f 2 | tr -d " ")
PKG:=pkgname-$(VERSION).ipk
DIR:=../source/
build-package:
rm -rf ipk
find $(DIR) -name "*.pyc" -exec rm -f {} \;
mkdir -p ipk/{bin,etc/{init.d,config,crontabs}}
install -m755 $(DIR)bin/* ipk/bin/
install -m755 $(DIR)etc/init.d/* ipk/etc/init.d/
find ipk -type f -exec md5sum {} \; > md5sums; sed -i 's/ipk\///' md5sums
tar czvf control.tar.gz control postinst
cd ipk; fakeroot tar czvf ../data.tar.gz .; cd ..
echo 2.0 > debian-binary
tar zcpvf $(PKG) control.tar.gz data.tar.gz debian-binary md5sums
build-index:
./make-index.sh . > Packages
signify -S -m Packages -s opkg-foo.sec
gzip -c Packages > Packages.gz
copy-files-to-repo:
scp Packages* $(PKG) opkg.foo.org:repo/
clean: FORCE
rm -rf ipk
rm -f control.tar.gz
rm -f data.tar.gz
rm -f debian-binary
rm -f md5sums
rm -f Packages*
rm -i *.ipk
FORCE:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment