Skip to content

Commit

Permalink
restructure packages' content so that it would be in sync with make i…
Browse files Browse the repository at this point in the history
…nstall targets;
  • Loading branch information
neodix42 committed Jan 10, 2024
1 parent 499cafd commit 1391943
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 39 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/create-aur-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/create-deb-ppa-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/create-rpm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'/-/./')
Expand All @@ -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 .
Expand Down
11 changes: 4 additions & 7 deletions packages/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
2 changes: 1 addition & 1 deletion packages/deb/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions packages/deb/debian/install
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#debian/usr/bin /usr
#debian/usr/lib /usr
#debian/usr/share /usr
5 changes: 3 additions & 2 deletions packages/deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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/

3 changes: 2 additions & 1 deletion packages/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 5 additions & 8 deletions packages/rpm/SPECS/ton.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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}/*

0 comments on commit 1391943

Please sign in to comment.