8cd040e7e58e8d0abbd13b1f8063cb841d16c917
[ipfire-2.x.git] / src / scripts / make-packages.sh
1 #!/bin/bash
2 ########################################################
3 ## ##
4 ## Make packages ##
5 ## ##
6 ## (c) www.ipfire.org - GPL ##
7 ## ##
8 ########################################################
9 echo "`date -u '+%b %e %T'`: Packing $1" | tee -a $LOGFILE
10 cd / && mkdir -p /paks/$1
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 tar cfz /paks/$1/files.tgz --files=/usr/src/src/paks/$1/ROOTFILES --exclude='#*'
17 tar cfz /paks/$1/conf.tgz --files=/usr/src/src/paks/$1/CONFFILES --exclude='#*'
18 cd /paks/$1 && tar cfz ../$2.tar.gz files.tgz conf.tgz install.sh uninstall.sh && cd ..
19 md5sum $2.tar.gz >> $2.tar.gz.md5
20
21 ## Clean up!
22 #
23 rm -rf /paks/$1
24
25 exit 0