Skip to content

Instantly share code, notes, and snippets.

@garlic0x1
Created December 12, 2023 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garlic0x1/8754f2b785404e8953f6511cfe3a1442 to your computer and use it in GitHub Desktop.
Save garlic0x1/8754f2b785404e8953f6511cfe3a1442 to your computer and use it in GitHub Desktop.
Hello RPM

Hello Rpm

hello.spec:

Name:     hello
Version:  2.10
Release:  %autorelease
Summary:  Produces a familiar, friendly greeting
License:  GPL-3.0-or-later
URL:      https://www.gnu.org/software/hello/
Source:   http://ftp.gnu.org/gnu/hello/hello-%{version}.tar.gz

BuildRequires:   gcc
BuildRequires:   make
BuildRequires:   gettext
BuildRequires:   sed
BuildRequires:   bash
BuildRequires:   coreutils
BuildRequires:   glibc-common

%description
The GNU Hello program produces a familiar, friendly greeting. Yes, this is
another implementation of the classic program that prints "Hello, world!" when
you run it.

%prep
%autosetup
mv THANKS THANKS.old
iconv --from-code=ISO-8859-1 --to-code=UTF-8 --output=THANKS THANKS.old

%build
%configure \
    --enable-nls \
    --disable-rpath
%make_build

%install
%make_install
test -f %{buildroot}/%{_infodir}/dir && rm %{buildroot}/%{_infodir}/dir

%check
make check

%files
%{_bindir}/hello
%{_mandir}/man1/hello.1.*
%{_infodir}/hello.info.*
%{_datadir}/locale/*/LC_MESSAGES/hello.mo
%doc AUTHORS ChangeLog NEWS README THANKS TODO
%license COPYING

%changelog
%autochangelog

fetch code:

spectool -g hello.spec

test package:

sudo fedpkg --release f39 mockbuild

install package:

sudo dnf -C -y install ./results_hello/2.10/1.fc38/hello-2.10-1.fc38.x86_64.rpm

undo:

sudo dnf -C -y history undo last
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment