]>
Commit | Line | Data |
---|---|---|
483f59cd MT |
1 | #!/bin/bash |
2 | ||
3 | PROG="$1" | |
4 | VER="$2" | |
5 | PAK_VER="$3" | |
6 | ||
7 | if [ -f /install/packages/$PROG-$VER-$PAK_VER.tar.gz.empty ]; then | |
8 | ||
9 | echo -e "Package already exists." | |
10 | ||
11 | else | |
12 | ||
13 | # Bringing the files to their right place. | |
14 | rm -rf /install/packages/package /tmp/* /packagetmp.tar | |
15 | mkdir -p /install/packages/package | |
16 | cp -f /usr/src/src/paks/$PROG/{,un}install.sh /install/packages/package | |
17 | cp -f /usr/src/src/paks/$PROG/ROOTFILES /install/packages/package | |
18 | chmod 755 /install/packages/package/{,un}install.sh | |
19 | ||
20 | cd / && tar --create --directory=/ --files-from=/install/packages/package/ROOTFILES --file=/packagetmp.tar --exclude='#*' | |
21 | cd / && tar -x -C /tmp -f /packagetmp.tar | |
22 | rm -f /packagetmp.tar | |
23 | cd /tmp && tar --create --gzip --verbose --file=/install/packages/package/files.tgz * | |
24 | ||
25 | cd / && rm -rf /tmp/* | |
26 | cd /install/packages/package && cat ROOTFILES | grep -v "#" > ROOTFILES | |
27 | tar cfz ../$PROG-$VER-$PAK_VER.tar.gz files.tgz install.sh uninstall.sh ROOTFILES | |
28 | ||
29 | cd /install/packages && md5sum $PROG*.tar.gz > $PROG-$VER-$PAK_VER.tar.gz.md5 | |
30 | rm -rf /install/packages/package | |
31 | exit 0 | |
371d9df0 | 32 | fi |