-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from Achiefs/11-add-packages
Add package generation, package build tests, config improvements and more
- Loading branch information
Showing
21 changed files
with
351 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.rpm filter=lfs diff=lfs merge=lfs -text | ||
*.deb filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Pkg build | ||
on: [push] | ||
jobs: | ||
Pkg-build-ubuntu: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out repository code, branch='${{ github.ref }}' | ||
uses: actions/checkout@v2 | ||
- name: Install required dependencies | ||
run: sudo apt install -y curl devscripts equivs tar gcc | ||
- name: Building package | ||
run: cd pkg/deb && sudo ./builder.sh | ||
- run: echo "Job's status is ${{ job.status }}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: 0.2.0 | ||
|
||
# Monitor folder or files in unix. | ||
monitor: | ||
- path: /tmp/ | ||
- path: /bin/ | ||
- path: /usr/bin/ | ||
- path: /etc | ||
|
||
# Path to output and events files: | ||
# output to write app log. | ||
# events to write monitorized folder/files events. | ||
log: | ||
output: | ||
file: /var/log/fim/fim.log | ||
# Possible levels debug, info, error, warning | ||
level: debug | ||
events: | ||
file: /usr/share/fim/events.json | ||
# Format of output events options json/syslog | ||
format: json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: 0.2.0 | ||
|
||
# Monitor folder or files in windows. | ||
monitor: | ||
- path: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup | ||
- path: C:\Program Files\ | ||
- path: C:\Users\ | ||
- path: C:\Windows\Temp\ | ||
|
||
# Path to output and events files: | ||
# output to write app log. | ||
# events to write monitorized folder/files events. | ||
log: | ||
output: | ||
file: C:\ProgramData\fim\fim.log | ||
# Possible levels debug, info, error, warning | ||
level: debug | ||
events: | ||
file: C:\ProgramData\fim\events.json | ||
# Format of output events options json/syslog | ||
format: json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# Dependencies: curl, devscripts, equivs, tar, gcc | ||
set -ex | ||
|
||
brand="fim" | ||
target_dir=$(pwd) | ||
architecture="amd64" | ||
base_dir="${target_dir}/../../" | ||
version="$(head -n1 ${base_dir}/config/linux/config.yml | cut -d' ' -f2)" | ||
release="1" | ||
|
||
# Build directories | ||
build_dir="/tmp/${brand}" | ||
pkg_name="${brand}_${version}-${release}" | ||
sources_dir="${build_dir}/${pkg_name}" | ||
pkg_dir="${sources_dir}/pkg/deb" | ||
|
||
mkdir -p ${sources_dir} | ||
cp -R ${base_dir}/* ${sources_dir}/ | ||
|
||
# Generating directory structure to build the .deb package | ||
cd ${build_dir} && tar -czf ${pkg_name}.orig.tar.gz "${pkg_name}" | ||
|
||
# Installing build dependencies | ||
cd ${pkg_dir} | ||
mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y" | ||
|
||
# Build package | ||
debuild -b -uc -us | ||
|
||
full_pkg_name="${pkg_name}_${architecture}.deb" | ||
mv "${pkg_dir}/../${full_pkg_name}" ${target_dir}/ | ||
rm -rf ${build_dir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
fim (0.2.0-1) devel; urgency=medium | ||
|
||
* Initial release | ||
* More info: https://github.com/Achiefs/fim/releases/tag/v0.2.0 | ||
|
||
-- Jose Fernandez <[email protected]> Sat, 09 Oct 2021 14:00:00 +0000 | ||
|
||
fim (0.1.0-1) UNRELEASED; urgency=medium | ||
|
||
* Closes itp bug | ||
* More info: https://github.com/Achiefs/fim/releases/tag/v0.1.0 | ||
|
||
-- Jose Fernandez <[email protected]> Thu, 07 Oct 2021 22:45:00 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Source: fim | ||
Section: admin | ||
Priority: optional | ||
Maintainer: Jose Fernandez <[email protected]> | ||
Build-Depends: debhelper (>=10) | ||
Standards-Version: 4.0.0 | ||
Homepage: https://github.com/Achiefs/fim | ||
|
||
Package: fim | ||
Architecture: any | ||
Depends: ${shlibs:Depends} | ||
Description: This software helps you to monitor your files of any unwanted action. | ||
With FIM you could take a deep eye into your files | ||
and know when they are exactly changed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
This work was packaged for Debian by: | ||
|
||
Jose Fernandez <[email protected]> on Thu, 07 Oct 2021 22:45:00 +0000 | ||
|
||
It was downloaded from: | ||
|
||
https://github.com/Achiefs/fim/releases | ||
|
||
Upstream Authors: | ||
|
||
[email protected] | ||
[email protected] | ||
|
||
Copyright: | ||
|
||
GNU General Public License version 3. | ||
|
||
License: | ||
|
||
GNU General Public License version 3. | ||
|
||
The Debian packaging is: | ||
|
||
Copyright (C) 2021 Achiefs <[email protected]> | ||
|
||
and is licensed under the GPL version 3, | ||
see "/usr/share/common-licenses/GPL-3". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
INSTALL_DIR="/usr/local" | ||
|
||
case "$1" in | ||
remove|failed-upgrade|abort-install|abort-upgrade|disappear) | ||
rm -rf ${INSTALL_DIR}/bin/fim | ||
rm -rf ${INSTALL_DIR}/etc/fim/config.yml | ||
;; | ||
|
||
upgrade) | ||
;; | ||
|
||
*) | ||
echo "postrm called with unknown argument \`$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/make -f | ||
|
||
# Uncomment this to turn on verbose mode. | ||
export DH_VERBOSE=1 | ||
|
||
# This has to be exported to make some magic below work. | ||
export DH_OPTIONS | ||
|
||
# Package build options | ||
export BUILD_DIR="../.." | ||
export TARGET_DIR="${CURDIR}/debian/fim" | ||
export PKG_DIR="${TARGET_DIR}/usr" | ||
export CONFIG_DIR="${TARGET_DIR}/etc/fim" | ||
export BIN_DIR="${PKG_DIR}/bin" | ||
export DOC_DIR="${PKG_DIR}/share/doc/fim" | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_clean: | ||
|
||
override_dh_install: | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
|
||
echo ${CURDIR} | ||
${HOME}/.cargo/bin/cargo build --release | ||
|
||
mkdir -p ${CONFIG_DIR} | ||
mkdir -p ${BIN_DIR} | ||
mkdir -p ${DOC_DIR} | ||
install -m 0750 ${BUILD_DIR}/target/release/fim ${BIN_DIR}/ | ||
install -m 0640 ${BUILD_DIR}/config/linux/config.yml ${CONFIG_DIR}/ | ||
install -m 0640 ${BUILD_DIR}/pkg/deb/debian/copyright ${DOC_DIR}/ | ||
install -m 0640 ${BUILD_DIR}/pkg/deb/debian/changelog ${DOC_DIR}/ | ||
|
||
override_dh_installdocs: | ||
|
||
override_dh_installchangelogs: | ||
|
||
override_dh_perl: | ||
|
||
override_dh_link: | ||
|
||
.PHONY: override_dh_clean override_dh_install override_dh_installdocs override_dh_installchangelogs override_dh_perl override_dh_link |
Git LFS file not shown
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# Dependencies: rpm-build, tar, gcc | ||
set -ex | ||
|
||
brand="fim" | ||
current_dir=$(pwd) | ||
architecture="x86_64" | ||
rpmbuild="/usr/bin/rpmbuild" | ||
version="$(head -n1 ../../config/linux/config.yml | cut -d' ' -f2)" | ||
bin_path="/usr/bin" | ||
config_path="/etc/${brand}" | ||
|
||
# Build directories | ||
build_dir="/tmp/fim" | ||
pkg_name="${brand}-${version}" | ||
sources_dir="${build_dir}/${pkg_name}" | ||
rpm_build_dir="${build_dir}/rpmbuild" | ||
mkdir -p ${rpm_build_dir}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} | ||
|
||
# Prepare the sources directory to build the source tar.gz | ||
mkdir -p ${sources_dir} | ||
cp -R ../../* ${sources_dir} | ||
|
||
cp ${brand}.spec ${rpm_build_dir}/SPECS/${pkg_name}.spec | ||
|
||
# Generating source tar.gz | ||
cd ${build_dir} && tar czf "${rpm_build_dir}/SOURCES/${pkg_name}.tar.gz" "${pkg_name}" | ||
echo "%debug_package %{nil}" >> /root/.rpmmacros | ||
|
||
# Building RPM | ||
$rpmbuild --define "_topdir ${rpm_build_dir}" --define "_version ${version}" \ | ||
--define "_bindir ${bin_path}" --define "_configdir ${config_path}" \ | ||
--target ${architecture} -ba ${rpm_build_dir}/SPECS/${pkg_name}.spec | ||
|
||
cp ${rpm_build_dir}/RPMS/${architecture}/${brand}*.rpm ${current_dir}/ | ||
rm -rf ${build_dir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Summary: FIM software provides a easy way to watch your files. | ||
Name: fim | ||
Version: %{_version} | ||
Release: 1 | ||
License: GPL | ||
Group: System Environment/Daemons | ||
Source0: %{name}-%{version}.tar.gz | ||
URL: https://github.com/Achiefs/fim | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
Vendor: Achiefs <[email protected]> | ||
Packager: Jose Fernandez <[email protected]> | ||
AutoReqProv: no | ||
ExclusiveOS: linux | ||
|
||
%description | ||
FIM helps you to monitor your files of any unwanted action. | ||
|
||
%prep | ||
%setup -q | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y | ||
|
||
%build | ||
source $HOME/.cargo/env | ||
cargo build --release | ||
|
||
%install | ||
mkdir -p -m 640 ${RPM_BUILD_ROOT}%{_configdir} | ||
mkdir -p -m 640 ${RPM_BUILD_ROOT}%{_bindir} | ||
|
||
install -m 0750 target/release/fim ${RPM_BUILD_ROOT}%{_bindir}/ | ||
install -m 0640 config/linux/config.yml ${RPM_BUILD_ROOT}%{_configdir}/ | ||
|
||
%pre | ||
%post | ||
%preun | ||
|
||
%postun | ||
# If the package is been uninstalled | ||
if [ $1 = 0 ];then | ||
# Remove lingering folders and files | ||
rm -f %{_bindir}/%{name} | ||
rm -rf %{_configdir} | ||
fi | ||
|
||
%clean | ||
rm -fr %{buildroot} | ||
|
||
%files | ||
%defattr(-,root,root) | ||
%attr(750, root, root) %{_bindir}/fim | ||
%dir %attr(750, root, root) %{_configdir} | ||
%attr(640, root, root) %{_configdir}/config.yml | ||
|
||
|
||
%changelog | ||
* Tue Oct 05 2021 support <[email protected]> - 0.2.0 | ||
- More info: https://github.com/Achiefs/fim/releases/tag/v0.2.0 |
Git LFS file not shown
Oops, something went wrong.