Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add spec file needed to build rpms #111

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions dumb-init.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Name: dumb-init
Version: 1.1.3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update to current version

Release: 2%{?dist}
Summary: Entry-point for containers that proxies signals

License: MIT
URL: https://github.com/Yelp/dumb-init
Source0: https://github.com/Yelp/dumb-init/archive/v%{version}.tar.gz

BuildRequires: vim-common
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this build-depend on vim-common?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still curious why this depends on vim-common? (GitHub buried my original comment, it seems)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still curious why this depends on vim-common? (GitHub buried my original comment, it seems)

because I have a line that runs make VERSION.h (although it's commented out) which calls /bin/xdd which belongs to vim-common

[root@localhost ~]# rpm -qf /bin/xxd
vim-common-7.4.1868-1.fc24.x86_64

You can make it depend on /bin/xxd as filename if you wish
You can comment both out (so that the one who is building un-released version would enable both again)

BuildRequires: help2man

%description
dumb-init is a simple process supervisor and init system designed to run as
PID 1 inside minimal container environments (such as Docker).

* It can handle orphaned zombie processes.
* It can pass signals properly for simple containers.

%prep
%setup -q

%build

# if we are building a release then this is not needed
# make VERSION.h
gcc -std=gnu99 %{optflags} -o %{name} dumb-init.c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to statically compile here like we do for the Debian packages?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, fedora has quality guidelines and they require it to be dynamically linked.
they do this to go-lang binaries too like etcd. Static linking might need the approval of Fedora Engineering Steering Committee (FESCo) because its security concerns
we might if you wish provide a "dumb-init-static" subpackage.

https://fedoraproject.org/wiki/Packaging:Guidelines#Statically_Linking_Executables

I have opened a review ticket

https://bugzilla.redhat.com/show_bug.cgi?id=1367033

help2man --no-discard-stderr --include debian/help2man --no-info --name '%{summary}' ./%{name} | gzip -9 > %{name}.1.gz


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p "${RPM_BUILD_ROOT}/%{_bindir}" "${RPM_BUILD_ROOT}/%{_mandir}/man1/"
cp %{name} "${RPM_BUILD_ROOT}/%{_bindir}/"
cp %{name}.1.gz "${RPM_BUILD_ROOT}/%{_mandir}/man1/"

%files
%{_bindir}/%{name}
%license LICENSE
%doc README.md
%doc %{_mandir}/man1/%{name}.1.gz


%changelog
* Mon Aug 15 2016 alsadi <[email protected]> - 1.1.3-2
- initial packaging