Updated Makefile to change 'build' command to 'compile'
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2023-02-11 15:33:08 -05:00
parent b52a1ef08e
commit fa4e51a0e8
2 changed files with 61 additions and 30 deletions

View File

@ -2,7 +2,7 @@ BINARY_NAME=adept
all: build test all: build test
build: compile:
go build -o ${BINARY_NAME} adept.go go build -o ${BINARY_NAME} adept.go
test: test:
@ -34,4 +34,5 @@ uninstall:
clean: clean:
go clean go clean
rm ${BINARY_NAME}
.PHONY: all test clean

View File

@ -11,34 +11,64 @@ if [[ "${VERSION:0:1}" == "v" ]]; then
VERSION="${VERSION:1}" VERSION="${VERSION:1}"
fi fi
# Create workspace for our deb package # Tar up source files
WORKDIR="adept_$VERSION" mkdir rpm-temp
mkdir "$WORKDIR" cp -r cmd config transcoder util adept.go go.mod go.sum LICENSE Makefile README.md rpm-temp/
tar cvzf "adept-$VERSION.tar.gz" rpm-temp/*
# Copy build sources into workspace mv "adept-$VERSION.tar.gz" ~/rpmbuild/SOURCES/
cp -r build/etc "$WORKDIR/"
mkdir -p "$WORKDIR/usr/bin/"
cp "dist/adept-linux-amd64-v$VERSION" "$WORKDIR/usr/bin/adept"
# Create debian control file # Create debian control file
mkdir "$WORKDIR/DEBIAN" cat > "./adept.spec"<< EOF
cat > "$WORKDIR/DEBIAN/control"<< EOF Name: adept
Package: adept
Version: $VERSION Version: $VERSION
Section: video Release: 1%{?dist}
Priority: optional Summary: Bit Goblin video transcoding service
Architecture: amd64
Depends: ffmpeg (>= 4), lsof License: BSD 2-Clause
Maintainer: Gregory Ballantine <gballantine@bitgoblin.tech> Source0: %{name}-%{version}.tar.gz
Description: Bit Goblin video transcoding service.
BuildRequires: golang
BuildRequires: systemd-rpm-macros
Provides: %{name} = %{version}
%description
Bit Goblin video transcoding service
%global debug_package %{nil}
%prep
%autosetup
%build
go build -v -o %{name}
%install
install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -Dpm 0755 build/etc/%{name}/%{name}.toml %{buildroot}%{_sysconfdir}/%{name}/%{name}.toml
install -Dpm 644 build/etc/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
%check
# go test should be here... :)
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%files
%dir %{_sysconfdir}/%{name}
%{_bindir}/%{name}
%{_unitdir}/%{name}.service
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.toml
%changelog
* Thu Nov 17 2022 Gregory Ballantine $VERSION
- check git.metaunix.net/BitGoblin/adept for a changelog
EOF EOF
# Copy maintainer scripts
cp build/scripts/* "$WORKDIR/DEBIAN/"
#chmod +rx "$WORKDIR"/DEBIAN/pre*
chmod +rx "$WORKDIR"/DEBIAN/post*
# Build deb package! rpmbuild -ba adept.spec
dpkg-deb --build "$WORKDIR"
# Cleanup
rm -rf "$WORKDIR"