HAYASHI Kentaro
null+****@clear*****
Mon Jan 20 11:42:23 JST 2014
HAYASHI Kentaro 2014-01-20 11:42:23 +0900 (Mon, 20 Jan 2014) New Revision: e1f05b66e7278c0991ffc57d43492fa047ffd213 https://github.com/groonga/groonga-gobject/commit/e1f05b66e7278c0991ffc57d43492fa047ffd213 Message: deb: add required files to setup repository Added files: packages/Makefile.am packages/apt/Makefile.am packages/apt/build-deb.sh packages/apt/build-in-chroot.sh packages/apt/groonga-gobject-depended-packages packages/apt/sign-packages.sh packages/apt/sign-repository.sh packages/apt/update-repository.sh packages/debian/changelog packages/debian/compat packages/debian/control packages/debian/copyright packages/debian/patches/series packages/debian/rules packages/debian/source/format Added: packages/Makefile.am (+5 -0) 100644 =================================================================== --- /dev/null +++ packages/Makefile.am 2014-01-20 11:42:23 +0900 (19b9077) @@ -0,0 +1,5 @@ +SUBDIRS = \ + apt \ + rpm \ + yum \ + source Added: packages/apt/Makefile.am (+60 -0) 100644 =================================================================== --- /dev/null +++ packages/apt/Makefile.am 2014-01-20 11:42:23 +0900 (3268a12) @@ -0,0 +1,60 @@ +REPOSITORIES_PATH = repositories +DISTRIBUTIONS = debian ubuntu +CHROOT_BASE = /var/lib/chroot +ARCHITECTURES = i386 amd64 +CODES = wheezy jessie unstable lucid precise quantal raring saucy +KEYRING_PACKAGE = groonga-keyring +KEYRING_VERSION = 2012.05.29 +KEYRING_BASE_NAME = $(KEYRING_PACKAGE)-$(KEYRING_VERSION) + +all: + +release: build sign-packages update-repository sign-repository upload + +remove-existing-packages: + for distribution in $(DISTRIBUTIONS); do \ + find $(REPOSITORIES_PATH)/$${distribution}/pool \ + -type f -delete; \ + done + +ensure-rsync-path: + @if test -z "$(RSYNC_PATH)"; then \ + echo "--with-rsync-path configure option must be specified."; \ + false; \ + fi + +download: ensure-rsync-path + for distribution in $(DISTRIBUTIONS); do \ + rsync -avz --progress --delete \ + $(RSYNC_PATH)/$${distribution} \ + ${REPOSITORIES_PATH}/; \ + done + +sign-packages: + ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)' + +update-repository: + ./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \ + '$(ARCHITECTURES)' '$(CODES)' + +sign-repository: + ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)' + +upload: ensure-rsync-path + for distribution in $(DISTRIBUTIONS); do \ + (cd $(REPOSITORIES_PATH)/$${distribution}; \ + rsync -avz --progress --delete \ + dists pool $(RSYNC_PATH)/$${distribution}); \ + done + +build: build-package-deb + +build-package-deb: source + ./build-in-chroot.sh \ + $(PACKAGE) $(VERSION) $(srcdir)/.. $(REPOSITORIES_PATH)/ \ + $(CHROOT_BASE) '$(ARCHITECTURES)' '$(CODES)' + +source: ../$(PACKAGE)-$(VERSION).tar.gz + +../$(PACKAGE)-$(VERSION).tar.gz: + ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz ../ Added: packages/apt/build-deb.sh (+86 -0) 100755 =================================================================== --- /dev/null +++ packages/apt/build-deb.sh 2014-01-20 11:42:23 +0900 (28ee628) @@ -0,0 +1,86 @@ +#!/bin/sh + +LANG=C + +PACKAGE=$(cat /tmp/build-package) +USER_NAME=$(cat /tmp/build-user) +VERSION=$(cat /tmp/build-version) +DEPENDED_PACKAGES=$(cat /tmp/depended-packages) +BUILD_SCRIPT=/tmp/build-deb-in-chroot.sh + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +if [ ! -x /usr/bin/lsb_release ]; then + run apt-get update + run apt-get install -y lsb-release +fi + +distribution=$(lsb_release --id --short) +code_name=$(lsb_release --codename --short) + +security_list=/etc/apt/sources.list.d/security.list +if [ ! -f "${security_list}" ]; then + case ${distribution} in + Debian) + if [ "${code_name}" = "sid" ]; then + touch "${security_list}" + else + cat <<EOF > "${security_list}" +deb http://security.debian.org/ ${code_name}/updates main +deb-src http://security.debian.org/ ${code_name}/updates main +EOF + fi + ;; + Ubuntu) + cat <<EOF > "${security_list}" +deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted +deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted +EOF + ;; + esac +fi + +sources_list=/etc/apt/sources.list +if [ "$distribution" = "Ubuntu" ] && \ + ! (grep '^deb' $sources_list | grep -q universe); then + run sed -i'' -e 's/main$/main universe/g' $sources_list +fi + +if [ ! -x /usr/bin/aptitude ]; then + run apt-get update + run apt-get install -y aptitude +fi +run aptitude update -V -D +run aptitude safe-upgrade -V -D -y + +run aptitude install -V -D -y devscripts ${DEPENDED_PACKAGES} +run aptitude clean + +if ! id $USER_NAME >/dev/null 2>&1; then + run useradd -m $USER_NAME +fi + +cat <<EOF > $BUILD_SCRIPT +#!/bin/sh + +rm -rf build +mkdir -p build + +cp /tmp/${PACKAGE}-${VERSION}.tar.gz build/${PACKAGE}_${VERSION}.orig.tar.gz +cd build +tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz +cd ${PACKAGE}-${VERSION}/ +cp -rp /tmp/${PACKAGE}-debian debian +# export DEB_BUILD_OPTIONS=noopt +debuild -us -uc +EOF + +run chmod +x $BUILD_SCRIPT +run su - $USER_NAME $BUILD_SCRIPT Added: packages/apt/build-in-chroot.sh (+134 -0) 100755 =================================================================== --- /dev/null +++ packages/apt/build-in-chroot.sh 2014-01-20 11:42:23 +0900 (a074f0e) @@ -0,0 +1,134 @@ +#!/bin/sh + +if [ $# != 7 ]; then + echo "Usage: $0 PACKAGE VERSION SOURCE_DIR DESTINATION CHROOT_BASE ARCHITECTURES CODES" + echo " e.g.: $0 groonga 0.1.9 SOURCE_DIR repositories/ /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'" + exit 1 +fi + +PACKAGE=$1 +VERSION=$2 +SOURCE_DIR=$3 +DESTINATION=$4 +CHROOT_BASE=$5 +ARCHITECTURES=$6 +CODES=$7 + +PATH=/usr/local/sbin:/usr/sbin:$PATH + +script_base_dir=`dirname $0` + +if test "$PARALLEL" = "yes"; then + parallel="yes" +else + parallel="no" +fi + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +run_sudo() +{ + run sudo "$@" +} + +build_chroot() +{ + architecture=$1 + code_name=$2 + + run_sudo debootstrap --arch $architecture $code_name $base_dir + + case $code_name in + wheezy|unstable) + run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list + ;; + *) + run_sudo sed -i'' \ + -e 's,http://archive,http://jp.archive,' \ + -e 's/main$/main universe/' \ + $base_dir/etc/apt/sources.list + ;; + esac + + run_sudo sh -c "echo >> /etc/fstab" + run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab" + run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab" + run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab" + run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab" + run_sudo mount ${base_dir}/sys + run_sudo mount ${base_dir}/dev + run_sudo mount ${base_dir}/dev/pts + run_sudo mount ${base_dir}/proc +} + +build() +{ + architecture=$1 + code_name=$2 + + target=${code_name}-${architecture} + base_dir=${CHROOT_BASE}/${target} + if [ ! -d $base_dir ]; then + run build_chroot $architecture $code_name + fi + + case ${code_name} in + squeeze|wheezy|jessie|unstable) + distribution=debian + component=main + ;; + *) + distribution=ubuntu + component=universe + ;; + esac + + source_dir=${SOURCE_DIR} + build_user=${PACKAGE}-build + build_user_dir=${base_dir}/home/$build_user + build_dir=${build_user_dir}/build + pool_base_dir=${DESTINATION}${distribution}/pool/${code_name}/${component} + package_initial=$(echo ${PACKAGE} | sed -e 's/\(.\).*/\1/') + pool_dir=${pool_base_dir}/${package_initial}/${PACKAGE} + run cp $source_dir/${PACKAGE}-${VERSION}.tar.gz \ + ${CHROOT_BASE}/$target/tmp/ + run rm -rf ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian + run cp -rp $source_dir/debian/ \ + ${CHROOT_BASE}/$target/tmp/${PACKAGE}-debian + run echo $PACKAGE > ${CHROOT_BASE}/$target/tmp/build-package + run echo $VERSION > ${CHROOT_BASE}/$target/tmp/build-version + run echo $build_user > ${CHROOT_BASE}/$target/tmp/build-user + run cp ${script_base_dir}/${PACKAGE}-depended-packages \ + ${CHROOT_BASE}/$target/tmp/depended-packages + run cp ${script_base_dir}/build-deb.sh \ + ${CHROOT_BASE}/$target/tmp/ + run_sudo rm -rf $build_dir + run_sudo su -c "/usr/sbin/chroot ${CHROOT_BASE}/$target /tmp/build-deb.sh" + run mkdir -p $pool_dir + for path in $build_dir/*; do + [ -f $path ] && run cp -p $path $pool_dir/ + done +} + +for architecture in $ARCHITECTURES; do + for code_name in $CODES; do + if test "$parallel" = "yes"; then + build $architecture $code_name & + else + mkdir -p tmp + build_log=tmp/build-$code_name-$architecture.log + build $architecture $code_name 2>&1 | tee $build_log + fi; + done; +done + +if test "$parallel" = "yes"; then + wait +fi Added: packages/apt/groonga-gobject-depended-packages (+7 -0) 100644 =================================================================== --- /dev/null +++ packages/apt/groonga-gobject-depended-packages 2014-01-20 11:42:23 +0900 (1fa74b1) @@ -0,0 +1,7 @@ +debhelper +autotools-dev +pkg-config +libgroonga-dev +gtk-doc-tools +gobject-introspection +libgirepository1.0-dev Added: packages/apt/sign-packages.sh (+42 -0) 100755 =================================================================== --- /dev/null +++ packages/apt/sign-packages.sh 2014-01-20 11:42:23 +0900 (6e74f1c) @@ -0,0 +1,42 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 3 ]; then + echo "Usage: $0 GPG_UID DESITINATION CODES" + echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'" + exit 1 +fi + +GPG_UID=$1 +DESTINATION=$2 +CODES=$3 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +for code_name in ${CODES}; do + case ${code_name} in + wheezy|jessie|unstable) + distribution=debian + ;; + *) + distribution=ubuntu + ;; + esac + + base_directory=${DESTINATION}${distribution} + debsign -pgpg2 --re-sign -k${GPG_UID} \ + $(find ${base_directory} -name '*.dsc' -or -name '*.changes') & + if [ "${PARALLEL}" != "yes" ]; then + wait + fi +done + +wait Added: packages/apt/sign-repository.sh (+46 -0) 100755 =================================================================== --- /dev/null +++ packages/apt/sign-repository.sh 2014-01-20 11:42:23 +0900 (3125288) @@ -0,0 +1,46 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 3 ]; then + echo "Usage: $0 GPG_UID DESTINATION CODES" + echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'" + exit 1 +fi + +GPG_UID=$1 +DESTINATION=$2 +CODES=$3 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +for code_name in ${CODES}; do + case ${code_name} in + wheezy|jessie|unstable) + distribution=debian + ;; + *) + distribution=ubuntu + ;; + esac + + release=${DESTINATION}${distribution}/dists/${code_name}/Release + rm -f ${release}.gpg + gpg2 --sign --detach-sign --armor \ + --local-user ${GPG_UID} \ + --output ${release}.gpg \ + ${release} & + + if [ "${PARALLEL}" != "yes" ]; then + wait + fi +done + +wait Added: packages/apt/update-repository.sh (+130 -0) 100755 =================================================================== --- /dev/null +++ packages/apt/update-repository.sh 2014-01-20 11:42:23 +0900 (89cbd40) @@ -0,0 +1,130 @@ +#!/bin/sh + +script_base_dir=`dirname $0` + +if [ $# != 4 ]; then + echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES" + echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'wheezy jessie unstable'" + exit 1 +fi + +PROJECT_NAME=$1 +DESTINATION=$2 +ARCHITECTURES=$3 +CODES=$4 + +run() +{ + "$@" + if test $? -ne 0; then + echo "Failed $@" + exit 1 + fi +} + +update_repository() +{ + distribution=$1 + code_name=$2 + component=$3 + + rm -rf dists/${code_name} + mkdir -p dists/${code_name}/${component}/binary-i386/ + mkdir -p dists/${code_name}/${component}/binary-amd64/ + mkdir -p dists/${code_name}/${component}/source/ + + cat <<EOF > dists/.htaccess +Options +Indexes +EOF + + cat <<EOF > dists/${code_name}/${component}/binary-i386/Release +Archive: ${code_name} +Component: ${component} +Origin: The ${PROJECT_NAME} project +Label: The ${PROJECT_NAME} project +Architecture: i386 +EOF + + cat <<EOF > dists/${code_name}/${component}/binary-amd64/Release +Archive: ${code_name} +Component: ${component} +Origin: The ${PROJECT_NAME} project +Label: The ${PROJECT_NAME} project +Architecture: amd64 +EOF + + cat <<EOF > dists/${code_name}/${component}/source/Release +Archive: ${code_name} +Component: ${component} +Origin: The ${PROJECT_NAME} project +Label: The ${PROJECT_NAME} project +Architecture: source +EOF + + cat <<EOF > generate-${code_name}.conf +Dir::ArchiveDir "."; +Dir::CacheDir "."; +TreeDefault::Directory "pool/${code_name}/${component}"; +TreeDefault::SrcDirectory "pool/${code_name}/${component}"; +Default::Packages::Extensions ".deb"; +Default::Packages::Compress ". gzip bzip2"; +Default::Sources::Compress ". gzip bzip2"; +Default::Contents::Compress "gzip bzip2"; + +BinDirectory "dists/${code_name}/${component}/binary-i386" { + Packages "dists/${code_name}/${component}/binary-i386/Packages"; + Contents "dists/${code_name}/Contents-i386"; + SrcPackages "dists/${code_name}/${component}/source/Sources"; +}; + +BinDirectory "dists/${code_name}/${component}/binary-amd64" { + Packages "dists/${code_name}/${component}/binary-amd64/Packages"; + Contents "dists/${code_name}/Contents-amd64"; + SrcPackages "dists/${code_name}/${component}/source/Sources"; +}; + +Tree "dists/${code_name}" { + Sections "${component}"; + Architectures "i386 amd64 source"; +}; +EOF + apt-ftparchive generate generate-${code_name}.conf + chmod 644 dists/${code_name}/Contents-* + + rm -f dists/${code_name}/Release* + rm -f *.db + cat <<EOF > release-${code_name}.conf +APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project"; +APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project"; +APT::FTPArchive::Release::Architectures "i386 amd64"; +APT::FTPArchive::Release::Codename "${code_name}"; +APT::FTPArchive::Release::Suite "${code_name}"; +APT::FTPArchive::Release::Components "${component}"; +APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages"; +EOF + apt-ftparchive -c release-${code_name}.conf \ + release dists/${code_name} > /tmp/Release + mv /tmp/Release dists/${code_name} +} + +for code_name in ${CODES}; do + case ${code_name} in + wheezy|jessie|unstable) + distribution=debian + component=main + ;; + *) + distribution=ubuntu + component=universe + ;; + esac + + mkdir -p ${DESTINATION}${distribution} + (cd ${DESTINATION}${distribution} + update_repository $distribution $code_name $component) & + if [ "${PARALLEL}" != "yes" ]; then + wait + fi +done + +wait Added: packages/debian/changelog (+5 -0) 100644 =================================================================== --- /dev/null +++ packages/debian/changelog 2014-01-20 11:42:23 +0900 (2af9f87) @@ -0,0 +1,5 @@ +groonga-gobject (1.0.0-1) unstable; urgency=low + + * Initial release + + -- HAYASHI Kentaro <hayashi �� clear-code.com> Wed, 29 Jan 2014 00:00:00 +0900 Added: packages/debian/compat (+1 -0) 100644 =================================================================== --- /dev/null +++ packages/debian/compat 2014-01-20 11:42:23 +0900 (ec63514) @@ -0,0 +1 @@ +9 Added: packages/debian/control (+21 -0) 100644 =================================================================== --- /dev/null +++ packages/debian/control 2014-01-20 11:42:23 +0900 (15416db) @@ -0,0 +1,21 @@ +Source: groonga-gobject +Section: libs +Priority: optional +Maintainer: Groonga Project <packages �� groonga.org> +Build-Depends: + debhelper (>= 9), + autotools-dev +Standards-Version: 3.9.3 +Homepage: https://github.com/groonga/groonga-gobject + +Package: groonga-gobject +Section: libs +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + libgroonga-dev (>= 3.1.0) +Description: GObject wrapper of Groonga + Groonga is an open-source fulltext search engine and column store. + It lets you write high-performance applications that requires fulltext search. + . Added: packages/debian/copyright (+9 -0) 100644 =================================================================== --- /dev/null +++ packages/debian/copyright 2014-01-20 11:42:23 +0900 (3e82938) @@ -0,0 +1,9 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Groonga Project +Upstream-Contact: Groonga Project <packages �� groonga.org> +Source: http://packages.groonga.org/source/groonga-gobject/ + +Files: * +Copyright: Copyright 2013 Kouhei Sutou <kou �� clear-code.com> +License: LGPL-3.0 + See /usr/share/common-licenses/LGPL-3 for the full license text. Added: packages/debian/patches/series (+0 -0) 100644 =================================================================== --- /dev/null +++ packages/debian/patches/series 2014-01-20 11:42:23 +0900 (e69de29) Added: packages/debian/rules (+15 -0) 100755 =================================================================== --- /dev/null +++ packages/debian/rules 2014-01-20 11:42:23 +0900 (811e092) @@ -0,0 +1,15 @@ +#!/usr/bin/make -f +# -*- makefile-gmake -*- +# +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 +# This has to be exported to make some magic below work. +export DH_OPTIONS + +%: + dh $@ + +# disable 'make check'. +override_dh_auto_test: + +override_dh_install: Added: packages/debian/source/format (+1 -0) 100644 =================================================================== --- /dev/null +++ packages/debian/source/format 2014-01-20 11:42:23 +0900 (163aaf8) @@ -0,0 +1 @@ +3.0 (quilt) -------------- next part -------------- HTML����������������������������...Download