X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from smtp191.iad.emailsrvr.com (smtp191.iad.emailsrvr.com [207.97.245.191]) by lists.alpinelinux.org (Postfix) with ESMTP id B266C1EBFEE for ; Wed, 8 Dec 2010 21:21:58 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp49.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 538C91D80A5; Wed, 8 Dec 2010 16:21:58 -0500 (EST) X-Virus-Scanned: OK Received: by smtp49.relay.iad1a.emailsrvr.com (Authenticated sender: mcs-AT-darkregion.net) with ESMTPSA id 03D24190DA5; Wed, 8 Dec 2010 16:20:51 -0500 (EST) From: Matt Smith To: alpine-devel@lists.alpinelinux.org Cc: Matt Smith Subject: [alpine-devel] [PATCH] new: aports helper scripts Date: Wed, 8 Dec 2010 15:20:21 -0600 Message-Id: <1291843221-21222-1-git-send-email-mcs@darkregion.net> X-Mailer: git-send-email 1.7.3.2 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: I've created some helper scripts for aports, which I'll briefly cover here. New files: - aports/apk-aports.conf: configuration file for the following helper scripts - aports/apkindex.sh: creates a signed APKINDEX.tar.gz for your aports - aports/apkwrapper.sh: apk wrapper that uses your aports repository Let me know what you think. --- apk-aports.conf | 32 ++++++++++++++++++++++++++++++++ apkindex.sh | 34 ++++++++++++++++++++++++++++++++++ apkwrapper.sh | 22 ++++++++++++++++++++++ 3 files changed, 88 insertions(+), 0 deletions(-) create mode 100644 apk-aports.conf create mode 100755 apkindex.sh create mode 100755 apkwrapper.sh diff --git a/apk-aports.conf b/apk-aports.conf new file mode 100644 index 0000000..18aca10 --- /dev/null +++ b/apk-aports.conf @@ -0,0 +1,32 @@ +#!/bin/sh +################################################################################ +# Contributor: Matt Smith +# Maintainer: Matt Smith +# Description: apk/aports configuration, used by aports helper scripts +# Version: 2010-12-08T15:01-06:00 (ISO 8601:2004) +################################################################################ + +# REMOVE OR COMMENT THE FOLLOWING TWO LINES AND EDIT THE VARIABLES THAT FOLLOW. +echo -e "Not configured!\nPlease edit ${APK_APORTS_CONF} ..." +exit 1 + +# +# Path to aports directory, no trailing slash +APORTS_DIR=/home/user/aports + +# +# aport category directories to scan for .apk files, space delimited +APORTS_CATS="main testing" + +# +# Path to abuild private key +ABUILD_PRIV_KEY=/home/user/.abuild/user.rsa + +# +# Path to abuild public key +ABUILD_PUB_KEY=/etc/apk/keys/user.rsa.pub + + +# DO NOT EDIT BEYOND THIS POINT +APORTS_APKINDEX="${APORTS_DIR}/APKINDEX.tar.gz" +APORTS_REPOFILE="${APORTS_DIR}/APKREPO" diff --git a/apkindex.sh b/apkindex.sh new file mode 100755 index 0000000..44ebcc3 --- /dev/null +++ b/apkindex.sh @@ -0,0 +1,34 @@ +#!/bin/sh +################################################################################ +# Contributor: Matt Smith +# Maintainer: Matt Smith +# Description: aports helper script: creates a signed APKINDEX.tar.gz and +# APKREPO file for use with apk or aports/apkwrapper.sh +# Usage: apkindex.sh +# Version: 2010-12-08T14:52-06:00 (ISO 8601:2004) +################################################################################ + +# Get configuration: +APK_APORTS_CONF_NAME="apk-aports.conf" +if [ "${0:0:2}" == "./" ]; then + APK_APORTS_CONF="./${APK_APORTS_CONF_NAME}" +else + APK_APORTS_CONF="`echo $0 | \ + sed -r "s;^(/.*)/[^/]+;\1/${APK_APORTS_CONF_NAME};"`" +fi +source $APK_APORTS_CONF + +# Create APKINDEX.tar.gz for aports +APORTS_CAT_DIRS="" +for APORTS_CAT in $APORTS_CATS; do + APORTS_CAT_DIRS="${APORTS_CAT_DIRS} ${APORTS_DIR}/${APORTS_CAT}/*/*.apk" +done +apk index -o $APORTS_APKINDEX ${APORTS_CAT_DIRS:1} + +# Sign the aports APKINDEX.tar.gz +abuild-sign -k $ABUILD_PRIV_KEY -p $ABUILD_PUB_KEY $APORTS_APKINDEX + +# Create aports APKREPO to use like: +# apk --repositories-file $APKREPO add $APORTS_PKG +# (This is the purpose of aports/apkwrapper.sh) +echo "${APORTS_DIR}/" > $APORTS_REPOFILE diff --git a/apkwrapper.sh b/apkwrapper.sh new file mode 100755 index 0000000..306328e --- /dev/null +++ b/apkwrapper.sh @@ -0,0 +1,22 @@ +#!/bin/sh +################################################################################ +# Contributor: Matt Smith +# Maintainer: Matt Smith +# Description: aports helper script: apk wrapper that uses the signed +# APKINDEX.tar.gz and APKREPO files generated by aports/apkindex.sh +# Example Use: apkwrapper.sh add /path/to/aports/main/package/package-0.1-r0.apk +# Version: 2010-12-08T15:08-06:00 (ISO 8601:2004) +################################################################################ + +# Get configuration: +APK_APORTS_CONF_NAME="apk-aports.conf" +if [ "${0:0:2}" == "./" ]; then + APK_APORTS_CONF="./${APK_APORTS_CONF_NAME}" +else + APK_APORTS_CONF="`echo $0 | \ + sed -r "s;^(/.*)/[^/]+;\1/${APK_APORTS_CONF_NAME};"`" +fi +source $APK_APORTS_CONF + +# Invoke apk using the aports repository file +apk --repositories-file $APORTS_REPOFILE $* -- 1.7.3.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---