Skip to content

Commit

Permalink
feat: Use a modular build system
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpenedblade committed Feb 19, 2023
1 parent 7a8c5d4 commit ea025c9
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir /tmp/repo
docker run -t -v "$PWD":/repo -v "/tmp/repo":/tmp/repo fedora:37 /bin/bash -c "/repo/repo/build-repo.sh"
docker run -t -v "$PWD":/repo -v "/tmp/repo":/tmp/repo fedora:37 /bin/bash -c "/repo/build-repo.sh"
cp -r /tmp/repo ./deploy
- name: Upload
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Update repo
run: |
mkdir /tmp/repo
docker run -t -v "$PWD":/repo -v "/tmp/repo":/tmp/repo fedora:37 /bin/bash -c "/repo/repo/build-repo.sh"
docker run -t -v "$PWD":/repo -v "/tmp/repo":/tmp/repo fedora:37 /bin/bash -c "/repo/build-repo.sh"
cp -r /tmp/repo ./deploy
- name: Upload
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions build-spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# Location of sources/ and specs/
# Sources are in $BASE_DIR/sources/$PACKAGE_NAME
BASE_DIR=$1

# Name of spec file without the extension
# EXAMPLE: foo.spec -> foo
PACKAGE_NAME=$2

cd /root/rpmbuild/SPECS

echo "=====PREPARING SOURCES====="
cp "$BASE_DIR"/specs/"$PACKAGE_NAME".spec /root/rpmbuild/SPECS/
cp -r "$BASE_DIR"/sources/"$PACKAGE_NAME"/* /root/rpmbuild/SOURCES

echo "=====INSTALLING DEPENDENCIES====="
cd /root/rpmbuild/SPECS/
dnf -y builddep "$PACKAGE_NAME".spec

echo "=====BUILDING PACKAGE====="
cd /root/rpmbuild/SPECS/
rpmbuild -bb "$PACKAGE_NAME".spec
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dnf install -y koji fedora-packager git curl pesign rpmdevtools rpm-sign rpm-bui

echo "=====IMPORTING KEYS====="
gpg --import /repo/rpm_signing_key
rpm --import /repo/repo/t2linux-fedora.pub
rm -rfv /repo/rpm_signing_key
echo -e "%_signature gpg\n%_gpg_name T2Linux Fedora" > ~/.rpmmacros

Expand Down
12 changes: 2 additions & 10 deletions package-scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

cd /root/rpmbuild/SPECS

echo "=====EXTRACTING SOURCES====="
mv /repo/specs/t2linux-*.spec /root/rpmbuild/SPECS/
cp /repo/repo/* /root/rpmbuild/SOURCES

echo "=====PREPARING SOURCES====="
cd /root/rpmbuild/SPECS
dnf -y builddep t2linux-*.spec

echo "=====BUILDING====="
cd /root/rpmbuild/SPECS
rpmbuild -bb ./t2linux-config.spec
rpmbuild -bb ./t2linux-repo.spec
/repo/build-spec.sh /repo t2linux-config
/repo/build-spec.sh /repo t2linux-repo
File renamed without changes.
File renamed without changes.

0 comments on commit ea025c9

Please sign in to comment.