diff options
-rw-r--r-- | trunk/doc/CHANGELOG | 13 | ||||
-rw-r--r-- | trunk/mkbuild/generic.mkSlackBuild | 72 | ||||
-rw-r--r-- | trunk/mkbuild/model.mkbuild | 3 | ||||
-rw-r--r-- | trunk/mkbuild/perl.mkSlackBuild | 31 | ||||
-rwxr-xr-x | trunk/simplepkg.SlackBuild | 2 |
5 files changed, 112 insertions, 9 deletions
diff --git a/trunk/doc/CHANGELOG b/trunk/doc/CHANGELOG index b7ae446..a2773ce 100644 --- a/trunk/doc/CHANGELOG +++ b/trunk/doc/CHANGELOG @@ -1,6 +1,17 @@ simplepkg changelog =================== +0.6pre20 +======== + + - generic.mkSlackBuild: + - new section create_build_user_and_group + - new section move_config_files + - more gpg_signature_check section fixes + - new functions at postinstall_script section + - perl.mkSlackBuild: + - more gpg_signature_check section fixes + 0.6pre19 ======== @@ -8,6 +19,8 @@ simplepkg changelog - help function update - createpkg-1.1.11: - help function update + - generic.mkSlackBuild / perl.mkSlackbuild: + - gpg_signature_check section fixes 0.6pre18 ======== diff --git a/trunk/mkbuild/generic.mkSlackBuild b/trunk/mkbuild/generic.mkSlackBuild index 55bfba3..268b709 100644 --- a/trunk/mkbuild/generic.mkSlackBuild +++ b/trunk/mkbuild/generic.mkSlackBuild @@ -1,7 +1,7 @@ ################################################################# ## Generic template for SlackBuilds ## -## Version 0.9.5 - Luis ( luis at riseup d0t net) +## Version 0.9.6 - Luis ( luis at riseup d0t net) ## Alves ( rudsonalves at yahoo d0t com d0t br ) ################################################################# #!/bin/bash @@ -94,6 +94,16 @@ mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR </start_structure> +<create_build_user_and_group> off +# Creating build user and group +if ! grep -qe "^$PKG_NAME:" /etc/group; then + groupadd $PKG_NAME +fi +if ! grep -qe "^$PKG_NAME:" /etc/passwd; then + useradd $PKG_NAME -g $PKG_NAME +fi +</create_build_user_and_group> + <download_source> off # Dowload source if necessary SRC="[[SOURCE NAME CONSTRUCTION STRING]]" @@ -134,12 +144,37 @@ EOKEY fi # Download source's signature if necessary and check it -SIGNATURE="`basename [[SIGNING URL]]`" -if [ ! -s "$SRC_DIR/$SRC.sig" ]; then - wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET +if echo [[SIGNING URL]] | grep -q -v "SIGNING URL"; then + SIGNATURE="`basename [[SIGNING URL]]`" + if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then + wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET + fi +else + if [ -f "$SRC_DIR/$SRC.sig" ]; then + SIGNATURE="$SRC.sig" + elif [ -f "$SRC_DIR/$SRC.asc" ]; then + SIGNATURE="$SRC.asc" + else + echo Trying to get signature file from $URL.sig... + if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then + SIGNATURE="$SRC.sig" + else + rm $SRC_DIR/$SRC.sig + echo Trying to get signature file from $URL.asc... + if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then + SIGNATURE="$SRC.asc" + else + rm $SRC_DIR/$SRC.asc + echo "Error getting source's signature file" + exit $ERROR_GPG + fi + fi + fi fi +echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE... gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG +echo Success. </gpg_signature_check> <untar_source> off @@ -246,6 +281,13 @@ cat << EODESC > "$PKG/install/slack-desc" EODESC </slackdesc> +<move_config_files> off +# Move config files to .new to avoid overwriting any system config +for config_file in [[CONFIG FILES]]; do + mv $PKG/$config_file $PKG/$config_file.new +done +</move_config_files> + <postinstall_script> off # Add a post-installation script (doinst.sh) cat << EOSCRIPT > "$PKG/install/doinst.sh" @@ -262,7 +304,27 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -config path/to/config_file.new +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} + [[REST OF DOINST.SH]] EOSCRIPT </postinstall_script> diff --git a/trunk/mkbuild/model.mkbuild b/trunk/mkbuild/model.mkbuild index 00acbe2..73d8c7d 100644 --- a/trunk/mkbuild/model.mkbuild +++ b/trunk/mkbuild/model.mkbuild @@ -99,6 +99,7 @@ #[[MD5SUM EXTENSION]]="" #[[SIGNING KEY]]="" #[[SIGNING KEY URL]]="" +#[[CONFIG FILES]]="" [[PATCH FILES]]="" [[NUMBER OF PREFIX SLASHES TO STRIP]]="1" @@ -123,6 +124,7 @@ on: slkflags on: error_codes on: start_structure +off: create_build_user_and_group on: download_source off: md5sum_download_and_check_0 off: md5sum_download_and_check_1 @@ -137,6 +139,7 @@ off: compress_manpages off: compress_info_files on: install_documentation on: slackdesc +off: move_config_files off: postinstall_script on: build_package on: clean_builds diff --git a/trunk/mkbuild/perl.mkSlackBuild b/trunk/mkbuild/perl.mkSlackBuild index 617283a..856513a 100644 --- a/trunk/mkbuild/perl.mkSlackBuild +++ b/trunk/mkbuild/perl.mkSlackBuild @@ -135,12 +135,37 @@ EOKEY fi # Download source's signature if necessary and check it -SIGNATURE="`basename [[SIGNING URL]]`" -if [ ! -s "$SRC_DIR/$SRC.sig" ]; then - wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET +if echo [[SIGNING URL]] | grep -q -v "SIGNING URL"; then + SIGNATURE="`basename [[SIGNING URL]]`" + if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then + wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET + fi +else + if [ -f "$SRC_DIR/$SRC.sig" ]; then + SIGNATURE="$SRC.sig" + elif [ -f "$SRC_DIR/$SRC.asc" ]; then + SIGNATURE="$SRC.asc" + else + echo Trying to get signature file from $URL.sig... + if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then + SIGNATURE="$SRC.sig" + else + rm $SRC_DIR/$SRC.sig + echo Trying to get signature file from $URL.asc... + if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then + SIGNATURE="$SRC.asc" + else + rm $SRC_DIR/$SRC.asc + echo "Error getting source's signature file" + exit $ERROR_GPG + fi + fi + fi fi +echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE... gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG +echo Success. </gpg_signature_check> <untar_source> off diff --git a/trunk/simplepkg.SlackBuild b/trunk/simplepkg.SlackBuild index 5e4ae88..a670e12 100755 --- a/trunk/simplepkg.SlackBuild +++ b/trunk/simplepkg.SlackBuild @@ -18,7 +18,7 @@ PACKAGE="simplepkg" PACK_DIR="package-$PACKAGE" BUILD=${BUILD:=1rha} -VERSION="0.6pre19" +VERSION="0.6pre20" ARCH="noarch" LIBEXEC="/usr/libexec/$PACKAGE" BINDIR="/usr/bin" |