From 192a0660ae7af4b2c5eff1e25d376316353eb76c Mon Sep 17 00:00:00 2001 From: Kirill Timofeev Date: Fri, 2 Aug 2019 21:25:11 -0700 Subject: [PATCH] fpm dependency removed --- DEBIAN.urepo-uploader/control | 7 +++++ DEBIAN.urepo/control | 8 +++++ after-install.sh => DEBIAN.urepo/postinst | 0 before-remove.sh => DEBIAN.urepo/prerm | 0 README.md | 36 +++++++++++++---------- build-urepo-uploader.sh | 15 ---------- makefile | 30 +++++++++---------- 7 files changed, 50 insertions(+), 46 deletions(-) create mode 100644 DEBIAN.urepo-uploader/control create mode 100644 DEBIAN.urepo/control rename after-install.sh => DEBIAN.urepo/postinst (100%) rename before-remove.sh => DEBIAN.urepo/prerm (100%) delete mode 100755 build-urepo-uploader.sh diff --git a/DEBIAN.urepo-uploader/control b/DEBIAN.urepo-uploader/control new file mode 100644 index 0000000..d322dab --- /dev/null +++ b/DEBIAN.urepo-uploader/control @@ -0,0 +1,7 @@ +Package: urepo-uploader +Version: 2.0.0 +Architecture: amd64 +Section: default +Priority: extra +Maintainer: Hulu +Description: Uploading tool for urepo (universal repository for linux binary packages) diff --git a/DEBIAN.urepo/control b/DEBIAN.urepo/control new file mode 100644 index 0000000..8f170f3 --- /dev/null +++ b/DEBIAN.urepo/control @@ -0,0 +1,8 @@ +Package: urepo +Version: 2.2.3 +Architecture: amd64 +Depends: nginx, fcgiwrap, createrepo +Section: default +Priority: extra +Maintainer: Hulu +Description: Universal repository for linux binary packages diff --git a/after-install.sh b/DEBIAN.urepo/postinst similarity index 100% rename from after-install.sh rename to DEBIAN.urepo/postinst diff --git a/before-remove.sh b/DEBIAN.urepo/prerm similarity index 100% rename from before-remove.sh rename to DEBIAN.urepo/prerm diff --git a/README.md b/README.md index 88f16a2..f9d376b 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Drawbacks of current system: ## Building urepo Currently urepo can be installed **only** on Ubuntu or other Debian derivatives. +Urepo build relies on the ```dpkg-deb``` option ```--root-owner-group``` and will fail if your version of ```dpkg-deb``` doesn't support this option. ### Requirements @@ -50,10 +51,6 @@ First you'll need to install a few packages to correctly build: apt install git build-essential nginx fcgiwrap createrepo ``` -#### Install FPM - -Urepo requires fpm to run correctly, please do follow the [installation](http://fpm.readthedocs.io/en/latest/installing.html) process before to proceed. - ### Download urepo Time to download urepo, follow these steps: @@ -84,26 +81,33 @@ We don't cover other parameters since they are more easy to change, for example Now you can build your urepo as follow: ``` -make pkg +make ``` If all goes well, it should tell you something like this: ``` gcc -Wall -O2 -o extract-post-file extract-post-file.c -mkdir build +test/run-test.sh +001-1kb-test ok +002-empty-test ok +003-text-test ok +004-1kb-text-test ok +005-text-1kb-test ok +007-1kb-field-test ok +008-field-1kb-field-test ok +009-1kb-field-text-test ok +010-field-1kb-field-text-field-test ok +Summary: 9 tests passed, 0 tests failed +mkdir -p build +rm -rf build/* cp -r {var,etc} build/ +cp -r DEBIAN.urepo build/DEBIAN cp extract-post-file build/var/urepo/cgi -cd build && \ -fpm --deb-user root --deb-group root \ - -d nginx -d fcgiwrap -d createrepo \ - --deb-no-default-config-files \ - --description "Universal repository for linux binary packages" \ - --after-install ../after-install.sh \ - --before-remove ../before-remove.sh \ - -s dir -t deb -v 2.1.2 -n urepo `find . -type f` && \ -rm -rf `ls|grep -v deb$` -Created package {:path=>"urepo_2.1.2_amd64.deb"} +chmod -R go-w build +. <(grep -E "^(Package|Version|Architecture):" build/DEBIAN/control |sed -e 's/: \(.*\)/="\1"/') && \ +dpkg-deb --root-owner-group -b ./build ${Package}_${Version}_${Architecture}.deb +dpkg-deb: building package 'urepo' in 'urepo_2.2.3_amd64.deb'. ``` If you have the following error message: diff --git a/build-urepo-uploader.sh b/build-urepo-uploader.sh deleted file mode 100755 index 4700058..0000000 --- a/build-urepo-uploader.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -PKG_VERSION="2.0.0" -PKG_NAME="urepo-upload" - -PKG_DESCRIPTION="Uploading tool for urepo (universal repository for linux binary packages)" - -fpm --deb-user root --deb-group root \ - --description "${PKG_DESCRIPTION}" \ - -a all -s dir -t deb -v ${PKG_VERSION} -n ${PKG_NAME} $(find {usr/bin,etc/skel} -type f) - -fpm --rpm-user root --rpm-group root \ - --description "${PKG_DESCRIPTION}" \ - -a all -s dir -t rpm -v ${PKG_VERSION} -n ${PKG_NAME} $(find {usr/bin,etc/skel} -type f) - diff --git a/makefile b/makefile index 43176d0..403cbaa 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,3 @@ -PKG_NAME=urepo -PKG_VERSION=2.2.3 -PKG_DESCRIPTION="Universal repository for linux binary packages" - .PHONY: all SHELL=/bin/bash @@ -9,19 +5,23 @@ all: pkg bin: gcc -Wall -O2 -o extract-post-file extract-post-file.c clean: - rm -rf extract-post-file build + rm -rf extract-post-file build *.deb test: bin test/run-test.sh pkg: test - mkdir build + mkdir -p build + rm -rf build/* cp -r {var,etc} build/ + cp -r DEBIAN.urepo build/DEBIAN cp extract-post-file build/var/urepo/cgi - cd build && \ - fpm --deb-user root --deb-group root \ - -d nginx -d fcgiwrap -d createrepo \ - --deb-no-default-config-files \ - --description $(PKG_DESCRIPTION) \ - --after-install ../after-install.sh \ - --before-remove ../before-remove.sh \ - -s dir -t deb -v $(PKG_VERSION) -n $(PKG_NAME) `find . -type f` && \ - find . ! -name '*.deb' -delete + chmod -R go-w build + . <(grep -E "^(Package|Version|Architecture):" build/DEBIAN/control |sed -e 's/: \(.*\)/="\1"/') && \ + dpkg-deb --root-owner-group -b ./build $${Package}_$${Version}_$${Architecture}.deb +uploader: + mkdir -p build + rm -rf build/* + cp -r usr build/ + cp -r DEBIAN.urepo-uploader build/DEBIAN + chmod -R go-w build + . <(grep -E "^(Package|Version|Architecture):" build/DEBIAN/control |sed -e 's/: \(.*\)/="\1"/') && \ + dpkg-deb --root-owner-group -b ./build $${Package}_$${Version}_$${Architecture}.deb