Skip to content

Commit

Permalink
symlink /usr/sbin/{bouncer} to /usr/bin/ (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored May 14, 2023
1 parent 0e4444e commit 95f5a20
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[packages]
exceptiongroup = "1.1.1"
pexpect = "4.8.0"
pytest-cs = {ref = "0.7.15", git = "https://github.com/crowdsecurity/pytest-cs.git"}
pytest-cs = {ref = "0.7.16", git = "https://github.com/crowdsecurity/pytest-cs.git"}
pytest-dependency = "0.5.1"
pytest-dotenv = "0.5.2"
flask = "2.2.3"
Expand Down
10 changes: 5 additions & 5 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ override_dh_auto_install:
install -D scripts/_bouncer.sh -t "debian/$$PKG/usr/lib/$$PKG/"; \
BACKEND=$$BACKEND envsubst '$$BACKEND' < config/$$BOUNCER.yaml | install -D /dev/stdin "debian/$$PKG/etc/crowdsec/bouncers/$$BOUNCER.yaml"; \
BIN="/usr/bin/$$BOUNCER" CFG="/etc/crowdsec/bouncers" envsubst '$$BIN $$CFG' < "config/$$BOUNCER.service" | install -D /dev/stdin "debian/$$PKG/etc/systemd/system/$$BOUNCER.service"; \
mkdir -p "debian/$$PKG/usr/sbin/"; \
ln -s "/usr/bin/$$BOUNCER" "debian/$$PKG/usr/sbin/$$BOUNCER"; \
done

execute_after_dh_fixperms:
Expand Down
4 changes: 4 additions & 0 deletions rpm/SPECS/crowdsec-firewall-bouncer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ rm -rf %{buildroot}

mkdir -p %{buildroot}%{_bindir}
install -m 755 %{name} %{buildroot}%{_bindir}/%{name}
# symlink for compatibility with old versions
mkdir -p %{buildroot}/usr/sbin
ln -s %{_bindir}/%{name} %{buildroot}/usr/sbin/%{name}

mkdir -p %{buildroot}/etc/crowdsec/bouncers
install -m 600 config/%{name}.yaml %{buildroot}/etc/crowdsec/bouncers/%{name}.yaml
Expand Down Expand Up @@ -128,6 +131,7 @@ Requires: nftables,gettext
%files -n %{name}-nftables
%defattr(-,root,root,-)
%{_bindir}/%{name}
/usr/sbin/%{name}
/usr/lib/%{name}/_bouncer.sh
%{_unitdir}/%{name}.service
%config(noreplace) /etc/crowdsec/bouncers/%{name}.yaml
Expand Down
4 changes: 2 additions & 2 deletions test/pkg/test_build_rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
pytestmark = pytest.mark.rpm


def test_rpm_build(rpm_package_path, skip_unless_rpm):
def test_rpm_build(rpm_package, skip_unless_rpm):
"""Test that the package can be built."""
assert rpm_package_path.exists(), f'Package {rpm_package_path} not found'
assert rpm_package.exists(), f'Package {rpm_package} not found'

0 comments on commit 95f5a20

Please sign in to comment.