From ba3359722cbf8aa7b0ed39e1f81d1d74ec88fecd Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 30 May 2009 20:39:07 +0200 Subject: optimize ipkg package management - generate ipkg control file from PKG_* variables - automatically install init scripts from ./files/*.init set #PKG pkgname to set the binary package - rename FWINIT -> INIT - move postinst and conffiles meta data to ./files - update the packages to the latest upstream version - remove some unready or unused package (strongswan,..) more cleanups needed after allmodconfig --- package/tor/Makefile | 14 +++++++------- package/tor/files/tor.conffiles | 1 + package/tor/files/tor.init | 4 +++- package/tor/files/tor.postinst | 24 ++++++++++++++++++++++++ package/tor/ipkg/tor.conffiles | 1 - package/tor/ipkg/tor.control | 5 ----- package/tor/ipkg/tor.postinst | 24 ------------------------ 7 files changed, 35 insertions(+), 38 deletions(-) create mode 100644 package/tor/files/tor.conffiles create mode 100644 package/tor/files/tor.postinst delete mode 100644 package/tor/ipkg/tor.conffiles delete mode 100644 package/tor/ipkg/tor.control delete mode 100644 package/tor/ipkg/tor.postinst (limited to 'package/tor') diff --git a/package/tor/Makefile b/package/tor/Makefile index 1918577ff..62d13315e 100644 --- a/package/tor/Makefile +++ b/package/tor/Makefile @@ -9,14 +9,17 @@ PKG_NAME:= tor PKG_VERSION:= 0.1.1.26 PKG_RELEASE:= 9 PKG_MD5SUM:= 0667df7a1f670bee5163b607aea172ba - -MASTER_SITES:= http://tor.eff.org/dist/ \ +PKG_DESCR:= An anonymous Internet communication system +PKG_SECTION:= net +PKG_DEPENDS:= libevent libopenssl libpthread zlib +PKG_URL:= http://tor.eff.org +PKG_SITES:= http://tor.eff.org/dist/ \ http://ftp.se.linux.org/crypto/tor/ \ http://tor.meulie.net/ include ${TOPDIR}/mk/package.mk -$(eval $(call PKG_template,TOR,tor,${PKG_VERSION}-${PKG_RELEASE})) +$(eval $(call PKG_template,TOR,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) CONFIGURE_STYLE:= gnu CONFIGURE_ENV+= ac_cv_libevent_normal=yes \ @@ -31,11 +34,8 @@ BUILD_STYLE:= auto INSTALL_STYLE:= auto post-install: - ${INSTALL_DIR} ${IDIR_TOR}/etc/init.d - ${INSTALL_BIN} ./files/tor.init ${IDIR_TOR}/etc/init.d/tor - ${INSTALL_DIR} ${IDIR_TOR}/etc/tor + ${INSTALL_DIR} ${IDIR_TOR}/usr/bin ${IDIR_TOR}/etc/tor ${INSTALL_DATA} ./files/torrc ${IDIR_TOR}/etc/tor/ - ${INSTALL_DIR} ${IDIR_TOR}/usr/bin ${CP} ${WRKINST}/usr/bin/tor ${IDIR_TOR}/usr/bin/ include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/tor/files/tor.conffiles b/package/tor/files/tor.conffiles new file mode 100644 index 000000000..2954287e6 --- /dev/null +++ b/package/tor/files/tor.conffiles @@ -0,0 +1 @@ +/etc/tor/torrc diff --git a/package/tor/files/tor.init b/package/tor/files/tor.init index e8804bb64..dd3759252 100644 --- a/package/tor/files/tor.init +++ b/package/tor/files/tor.init @@ -1,5 +1,7 @@ #!/bin/sh -#FWINIT 80 +#PKG tor +#INIT 80 + . /etc/rc.conf case $1 in diff --git a/package/tor/files/tor.postinst b/package/tor/files/tor.postinst new file mode 100644 index 000000000..9ca10117b --- /dev/null +++ b/package/tor/files/tor.postinst @@ -0,0 +1,24 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf tor tor NO + +# do not change below +# check if we are on real system +if [[ -z $IPKG_INSTROOT ]]; then + # create copies of passwd and group, if we use squashfs + rootfs=`mount |awk '/root/ { print $5 }'` + if [ "$rootfs" = "squashfs" ]; then + if [ -h /etc/group ]; then + rm /etc/group + cp /rom/etc/group /etc/group + fi + if [ -h /etc/passwd ]; then + rm /etc/passwd + cp /rom/etc/passwd /etc/passwd + fi + fi +fi + +gid=$(get_next_gid) +add_group tor $gid +add_user tor $(get_next_uid) $gid /tmp/.tor diff --git a/package/tor/ipkg/tor.conffiles b/package/tor/ipkg/tor.conffiles deleted file mode 100644 index 2954287e6..000000000 --- a/package/tor/ipkg/tor.conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/tor/torrc diff --git a/package/tor/ipkg/tor.control b/package/tor/ipkg/tor.control deleted file mode 100644 index bd1f79cbe..000000000 --- a/package/tor/ipkg/tor.control +++ /dev/null @@ -1,5 +0,0 @@ -Package: tor -Priority: optional -Section: net -Description: An anonymous Internet communication system -Depends: libevent, libopenssl, libpthread, zlib diff --git a/package/tor/ipkg/tor.postinst b/package/tor/ipkg/tor.postinst deleted file mode 100644 index 9ca10117b..000000000 --- a/package/tor/ipkg/tor.postinst +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -. $IPKG_INSTROOT/etc/functions.sh -add_rcconf tor tor NO - -# do not change below -# check if we are on real system -if [[ -z $IPKG_INSTROOT ]]; then - # create copies of passwd and group, if we use squashfs - rootfs=`mount |awk '/root/ { print $5 }'` - if [ "$rootfs" = "squashfs" ]; then - if [ -h /etc/group ]; then - rm /etc/group - cp /rom/etc/group /etc/group - fi - if [ -h /etc/passwd ]; then - rm /etc/passwd - cp /rom/etc/passwd /etc/passwd - fi - fi -fi - -gid=$(get_next_gid) -add_group tor $gid -add_user tor $(get_next_uid) $gid /tmp/.tor -- cgit v1.2.3