From 1391943610b464f972d2d21d33a48fbc948f0382 Mon Sep 17 00:00:00 2001 From: neodiX Date: Wed, 10 Jan 2024 18:17:35 +0100 Subject: [PATCH] restructure packages' content so that it would be in sync with make install targets; --- .github/workflows/create-aur-packages.yml | 4 ++- .github/workflows/create-deb-ppa-packages.yml | 26 +++++++++++------- .github/workflows/create-rpm-packages.yml | 27 ++++++++++++------- packages/arch/PKGBUILD | 11 +++----- packages/deb/debian/control | 2 +- packages/deb/debian/install | 1 + packages/deb/debian/rules | 5 ++-- packages/rpm.sh | 3 ++- packages/rpm/SPECS/ton.spec | 13 ++++----- 9 files changed, 53 insertions(+), 39 deletions(-) diff --git a/.github/workflows/create-aur-packages.yml b/.github/workflows/create-aur-packages.yml index 921a408..f3b73ea 100644 --- a/.github/workflows/create-aur-packages.yml +++ b/.github/workflows/create-aur-packages.yml @@ -29,8 +29,10 @@ jobs: TAG=$(git ls-remote --tags https://github.com/ton-blockchain/ton/ | tail -1 | sed -n -e 's/^.*tags\///p') TAG=$(echo $TAG | sed s'/-/./') echo "latest TAG = $TAG" - + +# ton-linux-x86-64.tar.gz comes from create-rpm workflow that commits this package to the current repo curl -Ls https://github.com/ton-blockchain/packages/releases/latest/download/ton-linux-x86-64.tar.gz -o ton-linux-x86-64.tar.gz + tar -tvf ton-linux-x86-64.tar.gz SHA256_AMD64=$(shasum -a 256 ton-linux-x86-64.tar.gz | cut -f 1 -d " ") sed -i "/\\tpkgver = /c\\\tpkgver = ${TAG:1}" packages/arch/.SRCINFO diff --git a/.github/workflows/create-deb-ppa-packages.yml b/.github/workflows/create-deb-ppa-packages.yml index 778139a..9440fbb 100644 --- a/.github/workflows/create-deb-ppa-packages.yml +++ b/.github/workflows/create-deb-ppa-packages.yml @@ -39,19 +39,27 @@ jobs: curl -Ls https://github.com/ton-blockchain/ton/releases/latest/download/ton-linux-x86_64.zip -o ton-linux-amd64.zip unzip -qq ton-linux-amd64.zip -d ton-linux-amd64 - rm -rf ton-linux-amd64/lib ton-linux-amd64/smartcont - mkdir -p ton-linux-deb-amd64/{bin,lib} + + mkdir -p ton-linux-deb-amd64/{bin,lib/fift,share/ton} + cp -r ton-linux-amd64/smartcont ton-linux-deb-amd64/share/ton/ + cp ton-linux-amd64/lib/* ton-linux-deb-amd64/lib/fift + rm -rf ton-linux-amd64/{lib,smartcont} + mv ton-linux-amd64/libtonlibjson.so* ton-linux-deb-amd64/lib/ + [ -e ton-linux-amd64/libemulator.so ] && mv ton-linux-amd64/libemulator.so ton-linux-deb-amd64/lib/ cp ton-linux-amd64/* ton-linux-deb-amd64/bin/ - mv ton-linux-deb-amd64/bin/libtonlibjson.so.0.5 ton-linux-deb-amd64/lib/ - chmod 555 ton-linux-deb-amd64/{bin,lib}/* + chmod -R 555 ton-linux-deb-amd64/{bin,lib,share}/* curl -Ls https://github.com/ton-blockchain/ton/releases/latest/download/ton-linux-arm64.zip -o ton-linux-arm64.zip unzip -qq ton-linux-arm64.zip -d ton-linux-arm64 - rm -rf ton-linux-arm64/lib ton-linux-arm64/smartcont - mkdir -p ton-linux-deb-arm64/{bin,lib} - cp ton-linux-arm64/* ton-linux-deb-arm64/bin/ - mv ton-linux-deb-arm64/bin/libtonlibjson.so.0.5 ton-linux-deb-arm64/lib/ - chmod 555 ton-linux-deb-arm64/{bin,lib}/* + + mkdir -p ton-linux-deb-arm64/{bin,lib/fift,share/ton} + cp -r ton-linux-arm64/smartcont ton-linux-deb-arm64/share/ton/ + cp ton-linux-arm64/lib/* ton-linux-deb-arm64/lib/fift + rm -rf ton-linux-arm64/{lib,smartcont} + mv ton-linux-arm64/libtonlibjson.so* ton-linux-deb-arm64/lib/ + [ -e ton-linux-arm64/libemulator.so ] && mv ton-linux-arm64/libemulator.so ton-linux-deb-arm64/lib/ + cp ton-linux-arm64/* ton-linux-deb-amd64/bin/ + chmod -R 555 ton-linux-deb-arm64/{bin,lib,share}/* mkdir -p both/{amd64,arm64} cp -R ton-linux-deb-amd64/* both/amd64/ diff --git a/.github/workflows/create-rpm-packages.yml b/.github/workflows/create-rpm-packages.yml index 781f537..baffce7 100644 --- a/.github/workflows/create-rpm-packages.yml +++ b/.github/workflows/create-rpm-packages.yml @@ -13,7 +13,7 @@ jobs: - name: Create rpm packages run: | - sudo apt install -y createrepo-c + sudo apt install -y createrepo-c rpm REPO_DIR=$PWD TAG=$(git ls-remote --tags https://github.com/ton-blockchain/ton/ | tail -1 | sed -n -e 's/^.*tags\///p') TAG=$(echo $TAG | sed s'/-/./') @@ -24,18 +24,25 @@ jobs: curl -Ls https://github.com/ton-blockchain/ton/releases/latest/download/ton-linux-x86_64.zip -o ton-linux-x86_64.zip unzip -qq ton-linux-arm64.zip -d ton-linux-arm64 unzip -qq ton-linux-x86_64.zip -d ton-linux-x86_64 - rm -rf ton-linux-arm64/{lib,smartcont} - rm -rf ton-linux-x86_64/{lib,smartcont} - mkdir -p ton-linux-rpm-aarch64/{bin,lib} - cp ton-linux-arm64/* ton-linux-rpm-aarch64/bin/ - mv ton-linux-rpm-aarch64/bin/libtonlibjson.so.0.5 ton-linux-rpm-aarch64/lib/ - chmod 555 ton-linux-rpm-aarch64/{bin,lib}/* + mkdir -p ton-linux-rpm-aarch64/{bin,lib/fift,share/ton} + cp -r ton-linux-arm64/smartcont ton-linux-rpm-aarch64/share/ton/ + cp ton-linux-arm64/lib/* ton-linux-rpm-aarch64/lib/fift/ + rm -rf ton-linux-arm64/{lib,smartcont} + mv ton-linux-arm64/libtonlibjson.so* ton-linux-rpm-aarch64/lib/ + [ -e ton-linux-arm64/libemulator.so ] && mv ton-linux-arm64/libemulator.so ton-linux-rpm-aarch64/lib/ + cp ton-linux-arm64/* ton-linux-rpm-aarch64/bin/ + chmod -R 555 ton-linux-rpm-aarch64/{bin,lib,share}/* - mkdir -p ton-linux-rpm-x86_64/{bin,lib} + mkdir -p ton-linux-rpm-x86_64/{bin,lib/fift,share/ton} + cp -r ton-linux-x86_64/smartcont ton-linux-rpm-x86_64/share/ton/ + cp ton-linux-x86_64/lib/* ton-linux-rpm-x86_64/lib/fift/ + rm -rf ton-linux-x86_64/{lib,smartcont} + mv ton-linux-x86_64/libtonlibjson.so* ton-linux-rpm-x86_64/lib/ + [ -e ton-linux-x86_64/libemulator.so ] && mv ton-linux-x86_64/libemulator.so ton-linux-rpm-x86_64/lib/ cp ton-linux-x86_64/* ton-linux-rpm-x86_64/bin/ - mv ton-linux-rpm-x86_64/bin/libtonlibjson.so.0.5 ton-linux-rpm-x86_64/lib/ - chmod 555 ton-linux-rpm-x86_64/{bin,lib}/* + chmod -R 555 ton-linux-rpm-x86_64/{bin,lib,share}/* + mkdir ton-linux-x86_64-tmp cp -R ton-linux-rpm-x86_64/* ton-linux-x86_64-tmp tar -czvf ton-linux-x86-64.tar.gz -C ton-linux-x86_64-tmp . diff --git a/packages/arch/PKGBUILD b/packages/arch/PKGBUILD index 8d28c56..7efc5aa 100644 --- a/packages/arch/PKGBUILD +++ b/packages/arch/PKGBUILD @@ -13,13 +13,10 @@ sha256sums=('SKIP') package() { cd "$srcdir" - mkdir -p ${pkgdir}/usr/bin - cp -a bin/* ${pkgdir}/usr/bin - if [ -d lib ]; then - mkdir -p ${pkgdir}/usr/lib - cp -a lib/* ${pkgdir}/usr/lib; - fi - + mkdir -p ${pkgdir}/usr/{bin,lib/fift,share/ton} + cp -a bin/* ${pkgdir}/usr/bin/ + cp -ar share/* ${pkgdir}/usr/share/ + cp -ar lib/* ${pkgdir}/usr/lib/ # Fix permissions chmod -R go-w "${pkgdir}" } diff --git a/packages/deb/debian/control b/packages/deb/debian/control index ab39251..c6b3754 100644 --- a/packages/deb/debian/control +++ b/packages/deb/debian/control @@ -11,4 +11,4 @@ Architecture: any Multi-Arch: foreign Depends: ${misc:Depends}, ${shlibs:Depends} Description: TON is a fully decentralized layer-1 blockchain designed by Telegram to onboard billions of users. - Sources pulled and repaced from https://github.com/ton-blockchain/ton/releases + Sources pulled and replaced from https://github.com/ton-blockchain/ton/releases diff --git a/packages/deb/debian/install b/packages/deb/debian/install index 075c816..2d48336 100644 --- a/packages/deb/debian/install +++ b/packages/deb/debian/install @@ -1,2 +1,3 @@ #debian/usr/bin /usr #debian/usr/lib /usr +#debian/usr/share /usr diff --git a/packages/deb/debian/rules b/packages/deb/debian/rules index 7908cf7..f1f9cba 100644 --- a/packages/deb/debian/rules +++ b/packages/deb/debian/rules @@ -13,6 +13,7 @@ override_dh_builddeb: override_dh_install: install -d debian/ton/usr - cp --reflink=auto -a ./${DEB_BUILD_ARCH}/bin debian/ton/usr/ - cp --reflink=auto -a ./${DEB_BUILD_ARCH}/lib debian/ton/usr/ + cp --reflink=auto -ar ./${DEB_BUILD_ARCH}/bin debian/ton/usr/ + cp --reflink=auto -ar ./${DEB_BUILD_ARCH}/lib debian/ton/usr/ + cp --reflink=auto -ar ./${DEB_BUILD_ARCH}/share debian/ton/usr/ diff --git a/packages/rpm.sh b/packages/rpm.sh index ab73d1d..21f7668 100644 --- a/packages/rpm.sh +++ b/packages/rpm.sh @@ -15,11 +15,12 @@ TON_RELEASE=$5 mkdir -p "$RPMBUILD_PATH"/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} tar --create --file "$RPMBUILD_PATH"/SOURCES/ton.tar.gz --transform 's,^,ton-dev/,' -C "$NIX_RESULT_PATH" . -# _prefix, _bindir defines reset nix's _prefix, _bindir overrides to normal values rpmbuild --define "_topdir $RPMBUILD_PATH" \ --define "_prefix /usr" \ --define "_exec_prefix /usr" \ --define "_bindir /usr/bin" \ + --define "_libdir /usr/lib" \ + --define "_datadir /usr/share" \ --define "releasever $TON_RELEASE" \ --target "$PACKAGE_ARCH" \ -v -bb "$RPM_TEMPLATE_PATH" diff --git a/packages/rpm/SPECS/ton.spec b/packages/rpm/SPECS/ton.spec index 0242cbe..1242564 100644 --- a/packages/rpm/SPECS/ton.spec +++ b/packages/rpm/SPECS/ton.spec @@ -16,18 +16,15 @@ A collection of The Open Network core software and utilities. %setup -q %build -%define have_lib %( if [ -d lib ]; then echo "1" ; else echo "0"; fi ) %install -mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_libdir} +mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_libdir} %{buildroot}/%{_datadir} -cp -a bin/* %{buildroot}/%{_bindir} -%if %have_lib -cp -a lib/* %{buildroot}/%{_libdir} -%endif +cp -ar bin/* %{buildroot}/%{_bindir} +cp -ar lib/* %{buildroot}/%{_libdir} +cp -ar share/* %{buildroot}/%{_datadir} %files %{_bindir}/* -%if %have_lib %{_libdir}/* -%endif +%{_datadir}/*