Skip to content

Instantly share code, notes, and snippets.

@borisisok
Last active September 9, 2019 08:05
Show Gist options
  • Save borisisok/fc8fc9d6180252e4c450d0069517e736 to your computer and use it in GitHub Desktop.
Save borisisok/fc8fc9d6180252e4c450d0069517e736 to your computer and use it in GitHub Desktop.
rpm trigger processing example
Name: goodby-world
Version: 1
Release: 1
Summary: Next to most simple RPM package
License: FIXME
%description
This is my second RPM package, which does nothing.
%prep
# we have no source, so nothing here
%build
cat > goodby-world.sh <<EOF
#!/usr/bin/bash
echo Goodby world
EOF
%install
mkdir -p %{buildroot}/usr/bin/
install -m 755 goodby-world.sh %{buildroot}/usr/bin/goodby-world.sh
%files
/usr/bin/goodby-world.sh
%changelog
Name: hello-world
Version: 1
Release: 1
Summary: Most simple RPM package
License: FIXME
%description
This is my first RPM package, which does nothing.
%prep
# we have no source, so nothing here
%build
cat > hello-world.sh <<EOF
#!/usr/bin/bash
echo Hello world
EOF
%install
mkdir -p %{buildroot}/usr/bin/
install -m 755 hello-world.sh %{buildroot}/usr/bin/hello-world.sh
%files
/usr/bin/hello-world.sh
%triggerin -- goodby-world
echo "the world just ended" >> /tmp/trigger
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment