Matt Smith: 1 new: aports helper scripts 3 files changed, 88 insertions(+), 0 deletions(-)
On 12/09/2010 10:28 AM, Jeremy Thomerson wrote: > If it is not, can we get how to do this added to the wiki on the page > about building aports ? Just to add my $0.02, I find it much more useful to dump the apks into a directory that's exported by a web server. Then you can put that url in the /etc/apt/repositories (before the edge urls) of a second testing box - now when you install and test packages it won't affect your aports dev box. You can edit REPODEST in /etc/abuild.conf to put the compiled packages somewhere else (I use /srv/apks). Then I use nginx to serve them to my other alpine test boxes. Another, probably better, option is to just link ~/.cache/apks to /srv/apks. (The last option will automatically create your APKINDEX for you.) -Cameron
On Thursday, December 9, 2010 7:40am, "Natanael Copa" <ncopa@alpinelinux.org> said:
If it is not, can we get how to do this added to the wiki on the page about building aports ? Jeremy Thomerson -- sent from my "smart" phone, so please excuse spelling, formatting, or compiler errors On Dec 9, 2010 10:04 AM, "Natanael Copa" <ncopa@alpinelinux.org> wrote: On Thu, 2010-12-09 at 09:41 -0600, Matt Smith wrote: > On Thursday, December 9, 2010 7:40am, "Natana... ah. I yes. What i do is adding $HOME/.cache/apks first in /etc/apk/repositories
Natanael Copa <ncopa@alpinelinux.org>> If it is not, can we get how to do this added to the wiki on the page > about building aports ? yes, I agree that it would be good to have it documented properly. It is a wiki ;) -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---
then i do: abuild -r && apk add $package if there are additional http repos in /etc/apk/repositories you can pick some from local aports tree and some from network (to avoid build everything) > It's my understanding and experience that you can't simply "abuild -r; > apk add ./package.apk",... I think apk add ./package.apk is supposed to work but is buggy. > I suppose its no different though: doing --no-network, or specifying a > specific local reposito... np. and you are right. we could improve this.
On Thursday, December 9, 2010 10:03am, "Natanael Copa" <ncopa@alpinelinux.org> said:
On Thursday, December 9, 2010 3:18pm, "Natanael Copa" <ncopa@alpinelinux.org> said:
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.alpinelinux.org/~alpine/devel/patches/179/mbox | git am -3Learn more about email & git
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.
Natanael Copa <ncopa@alpinelinux.org>I'm not really sure what problem those scripts are supposed to solve?Matt Smith <mcs@darkregion.net>The idea is to make it easier/quicker to be able to install a package from aports (for testing, etc).Natanael Copa <ncopa@alpinelinux.org>ah. I yes. What i do is adding $HOME/.cache/apks first in /etc/apk/repositories then i do: abuild -r && apk add $package if there are additional http repos in /etc/apk/repositories you can pick some from local aports tree and some from network (to avoid build everything)It's my understanding and experience that you can't simply "abuild -r; apk add ./package.apk", atleast without specifying --no-network to apk, but that seems to be a 'global option' instead of being per-package.Natanael Copa <ncopa@alpinelinux.org>I think apk add ./package.apk is supposed to work but is buggy.I suppose its no different though: doing --no-network, or specifying a specific local repository (atleast without HTTP repositories added into the mix?). Ideally, I'd like to be able to "abuild -r; apk add ./package.apk" and have apk resolve dependencies either via /etc/apk/repositories (HTTP and/or local repos), or abuild the dependencies in aports instead, similar to FreeBSD ports, if I'm not mistaken. Apologies if this is already possible.Natanael Copa <ncopa@alpinelinux.org>np. and you are right. we could improve this.Thanks in advance, Matt P.S.: Looks like I could use some form of "abuild -ri".Natanael Copa <ncopa@alpinelinux.org>--- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ------ Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ----nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---
--- 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 <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +# 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 <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +# 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 <mcs@darkregion.net> +# Maintainer: Matt Smith <mcs@darkregion.net> +# 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 ---