c48ede91caac5a96d263fc3b73081b27ac617c9d
[people/pmueller/ipfire-2.x.git] / src / scripts / make-packages.sh
1 #!/bin/bash
2 ########################################################
3 ## ##
4 ## Make packages ##
5 ## ##
6 ## (c) www.ipfire.org - GPL v2 ##
7 ## ##
8 ########################################################
9 echo "`date -u '+%b %e %T'`: Packing $1" | tee -a $LOGFILE
10 cd / && mkdir -p /paks/$1/ROOT
11
12 ## Copy install.sh/uninstall.sh to pak-dir and make executeable
13 #
14 cp -f /usr/src/src/paks/$1/{,un}install.sh /paks/$1
15 chmod 755 /paks/$1/{,un}install.sh
16
17 # This tar+untar+tar is for removing files compressed twice
18 tar -c -C / --files-from=/usr/src/src/paks/$1/ROOTFILES -f /paks/$1/filestmp.tar --exclude='#*'
19 tar -x -C /paks/$1/ROOT -f /paks/$1/filestmp.tar
20 rm -f /paks/$1/filestmp.tar
21 cd /paks/$1/ROOT && tar zcf /paks/$1/files.tgz *
22
23 cd /paks/$1 && tar cvfz ../$2.tar.gz files.tgz install.sh uninstall.sh
24 cd .. && md5sum $2.tar.gz > $2.tar.gz.md5
25
26 rm -fr /paks/$1
27
28 exit 0