From a67bbcc340111bae8a2d7acc2c64699f15d31b5c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 5 Oct 2020 21:02:00 +0200 Subject: [PATCH] version and release automatized --- .drone.yml | 9 +++------ RELEASE | 1 + VERSION | 1 + build-deb.sh | 17 +++++++++++++++++ debian/changelog | 5 ----- debian/compat | 1 - debian/control | 10 ---------- debian/copyright | 7 ------- debian/postrm | 41 ----------------------------------------- debian/rules | 15 --------------- lch | 4 ++-- lch.spec | 6 +++--- 12 files changed, 27 insertions(+), 90 deletions(-) create mode 100644 RELEASE create mode 100644 VERSION create mode 100755 build-deb.sh delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/postrm delete mode 100755 debian/rules diff --git a/.drone.yml b/.drone.yml index d28b16c..501ca74 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ steps: sonar_host: https://sonar.hatthieves.es sonar_token: from_secret: sonar_token - sources: ./ + sources: . - name: Build Ubuntu deb package image: ubuntu @@ -17,12 +17,9 @@ steps: - name: deb_packages path: /debian commands: - - export DEBIAN_FRONTEND=noninteractive - - apt-get update && apt-get install -y dpkg-dev debhelper - - dpkg-buildpackage -us -uc - - cp ../*.deb . + - ./build-deb.sh - dpkg -i *.deb - - rm -rf /debian/* && cp *.deb /debian + - cp *.deb /debian && rm *.deb - lch -v - name: Build CentOS rpm package diff --git a/RELEASE b/RELEASE new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/RELEASE @@ -0,0 +1 @@ +10 diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..5a2a580 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.6 diff --git a/build-deb.sh b/build-deb.sh new file mode 100755 index 0000000..8e881a8 --- /dev/null +++ b/build-deb.sh @@ -0,0 +1,17 @@ +#!/bin/bash +VERSION=$(cat VERSION)r$(cat RELEASE) +mkdir -p "lch-$VERSION/DEBIAN" +echo -e "Package: lch +Version: $VERSION +Architecture: all +Maintainer: HatThieves +Depends: bash +Homepage: https://lch.hatthieves.es +Description: LCH - Linux Compressor Humanizer" > "lch-$VERSION/DEBIAN/control" +mkdir -p "lch-$VERSION/usr/bin" "lch-$VERSION/usr/lib/lch" "lch-$VERSION/usr/share/man/man1" +cp ./lch "lch-$VERSION/usr/bin" +cp -r ./lib/* "lch-$VERSION/usr/lib/lch" +gzip ./man/lch.1 -c > "lch-$VERSION/usr/share/man/man1/lch.1.gz" +chmod 644 "lch-$VERSION/usr/share/man/man1/lch.1.gz" +dpkg -b "lch-$VERSION" +rm -rf "lch-$VERSION" diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 25eb7e5..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -lch (0.6.10) unstable; urgency=medium - - * Initial release. - - -- Pedro Berrocal Sun, 04 Oct 2020 00:51:43 +0200 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 9a03714..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 \ No newline at end of file diff --git a/debian/control b/debian/control deleted file mode 100644 index 3620bdf..0000000 --- a/debian/control +++ /dev/null @@ -1,10 +0,0 @@ -Source: lch -Maintainer: Pedro Berrocal -Standards-Version: 0.6.10 -Section: utils -Build-Depends: debhelper (>= 10.2.5) - -Package: lch -Architecture: all -Description: Linux Compressor Humanizer - Download it and forget about writing arguments. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 987a099..0000000 --- a/debian/copyright +++ /dev/null @@ -1,7 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: falcot-data - -Files: * -Copyright: 2004-2019 Hatthieves -License: - All rights reserved. \ No newline at end of file diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index af8ede7..0000000 --- a/debian/postrm +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -if [ "$UID" != "0" ]; then - echo " Only root can execute this script, sorry." - echo " Try 'sudo $0'" - exit 0 -fi - -# Si existe el archivo lch -if [[ -f "/usr/bin/lch" ]]; then - rm /usr/bin/lch -fi - -# Si existe el directorio lch -if [[ -d "/usr/lib/lch" ]]; then - rm -rf "/usr/lib/lch" -fi - -# Si existe man -if [ -x "$(command -v man)" ]; then - # Si nulo manpath - if [ -z "$MANPATH" ]; then - MANPATH=$(manpath) - fi - - MANDIR=${MANPATH%%:*}/man1 - - # Si man lch.1 - if [[ -f "$MANDIR/lch.1" ]]; then - rm "$MANDIR/lch.1" - fi - - # Si man lch.1.gz - if [[ -f "$MANDIR/lch.1.gz" ]]; then - rm "$MANDIR/lch.1.gz" - fi -fi - -echo "==============================" -echo " lch uninstalled successfully." -echo -e "==============================\n" \ No newline at end of file diff --git a/debian/rules b/debian/rules deleted file mode 100755 index b2bfd7b..0000000 --- a/debian/rules +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/make -f - -%: - dh $@ - -override_dh_usrlocal: - -override_dh_auto_install: - ./bin/install.sh - -configure: - -clean: - dh_autoreconf_clean - dh_clean \ No newline at end of file diff --git a/lch b/lch index 860e85b..96a7963 100755 --- a/lch +++ b/lch @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERSION=0.6r10 +VERSION=$(cat VERSION)r$(cat RELEASE) DEST=$1 shift 1 ORIG=$@ @@ -47,4 +47,4 @@ else ;; esac exit 0 -fi \ No newline at end of file +fi diff --git a/lch.spec b/lch.spec index 153ff9a..c530847 100644 --- a/lch.spec +++ b/lch.spec @@ -6,8 +6,8 @@ # Summary: Linux Compress Humanizer Name: lch -Version: 0.6 -Release: 10 +Version: %(cat "$PWD/VERSION") +Release: %(cat "$PWD/RELEASE") License: GPL URL: https://lch.hatthieves.es Group: System @@ -16,7 +16,7 @@ Requires: bash BuildRoot: ./rpmbuild/ # Build with the following syntax: -# rpmbuild --target noarch -bb utils.spec +# rpmbuild --target noarch -bb lch.spec %description Linux Compress Humanizer