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

[merged] Add Makefile #164

Closed
wants to merge 1 commit into from
Closed

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Nov 2, 2016

No description provided.

@edsantiago
Copy link

LGTM but you might want to remove the Source0 - Source5 declarations in the specfile

@rhatdan
Copy link
Member Author

rhatdan commented Nov 2, 2016

Removed Source*

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Nov 2, 2016

This should install binaries in /usr/local/ instead of /usr ?

Who defines DESTDIR

@rhatdan
Copy link
Member Author

rhatdan commented Nov 2, 2016

It is defined in the RPM. Or anyone who installs it.

Whether it installs to /usr/local versus /usr is debatable. Especially where the /etc files are shred.

install -D -m 644 docker-storage-setup.conf ${DSSLIBDIR}/docker-storage-setup
install -D -m 644 docker-storage-setup-override.conf ${SYSCONFDIR}/docker-storage-setup
install -D -m 755 libdss.sh ${DSSLIBDIR}/libdss.sh
install -D -m 755 dss-child-read-write.sh ${DSSLIBDIR}/dss-child-read-write
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not preserce timestamps using -p option

Copy link
Member Author

Choose a reason for hiding this comment

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

Most likely not going to matter, since this is more about packaging in an RPM which is not going to preserve timestamps. I don't think these are usually preserved in a Makefile.

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Nov 2, 2016

Looks like shishir forgot to add dss-child-read-write to %files section in docker-storage-setup.spec file. We will have to fix it. Either as part of this PR or a separate PR.

install -D -m 755 docker-storage-setup.sh ${BINDIR}/docker-storage-setup
install -D -m 644 docker-storage-setup.service ${UNITDIR}/docker-storage-setup.service
install -D -m 644 docker-storage-setup.conf ${DSSLIBDIR}/docker-storage-setup
install -D -m 644 docker-storage-setup-override.conf ${SYSCONFDIR}/docker-storage-setup
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't like the idea of overwriting user's config file /etc/sysconfig/docker-storage-setup. Can't we do this only if /etc/sysconfig/docker-storage-setup is not present.

@rhatdan
Copy link
Member Author

rhatdan commented Nov 2, 2016

That can be done in the spec file Not usually done in the Makefile.

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Nov 2, 2016

spec file already has it.

%config(noreplace) %{_sysconfdir}/sysconfig/docker-storage-setup

I think it would be a real surprise to overwrite user's config file. I don't expect make install to overwrite my config files. Do you have any examples of other packages which do it.

@rhatdan
Copy link
Member Author

rhatdan commented Nov 2, 2016

Do you have any examples of packages that don't?

@rhatdan
Copy link
Member Author

rhatdan commented Nov 2, 2016

We can add a -b to the install line which will backup the older version.

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Nov 2, 2016

I think something like this will make sense. Overwrite /etc/sysconfig/docker-storage-setup only if it does not exist.

https://github.com/openssh/openssh-portable/blob/master/Makefile.in#L346
`

@rhatdan
Copy link
Member Author

rhatdan commented Nov 2, 2016

@rhvgoyal PTAL

@@ -54,9 +38,12 @@ install -p -m 755 %{SOURCE5} %{buildroot}/%{dsslibdir}/dss-child-read-write
%files
%{_unitdir}/docker-storage-setup.service
%{_bindir}/docker-storage-setup
%{dsslibdir}/docker-storage-setup
%config(noreplace) %{_sysconfdir}/sysconfig/docker-storage-setup-override
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought %files section is supposed to keep a list of files which are installed by package on system. And docker-storage-setup-override is not installed by package on the host.

%config(noreplace) %{_sysconfdir}/sysconfig/docker-storage-setup
%dir %{dsslibdir}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need %dir. Following webpage seems to say,

if a directory is specified in the %files list, the contents of that directory, and the contents of every directory under it, will automatically be included in the package

http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html

And we don't want that. We are mentioning each file individually.

@@ -54,9 +38,12 @@ install -p -m 755 %{SOURCE5} %{buildroot}/%{dsslibdir}/dss-child-read-write
%files
%{_unitdir}/docker-storage-setup.service
%{_bindir}/docker-storage-setup
%{dsslibdir}/docker-storage-setup
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we removing above. We put default config options in /usr/lib/docker-storage-setup/ and want to overwrite it on all package upgrades.

@@ -30,17 +24,7 @@ as the root logical volume and partition table.
%build

%install
install -d %{buildroot}%{_bindir}
Copy link
Collaborator

Choose a reason for hiding this comment

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

So previously, buildroot will define the root. Now we seem to be using DESTDIR as replacement for that. Who sets DESTDIR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no equivalent of _bindir though as we are hardcoding it to bin

install -d %{buildroot}%{_bindir}
install -p -m 755 %{SOURCE0} %{buildroot}%{_bindir}/docker-storage-setup
install -d %{buildroot}%{_unitdir}
install -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we are getting rid of macros like _unitdir, are we not going to be broken if tomorrow systemd changes location of unit files and this macro starts expanding to a different value.

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Nov 2, 2016

LGTM

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Nov 2, 2016

@rh-atomic-bot r+

@rh-atomic-bot
Copy link

📌 Commit 8fd6747 has been approved by rhvgoyal

@rh-atomic-bot
Copy link

⌛ Testing commit 8fd6747 with merge 8807a48...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: rhvgoyal
Pushing 8807a48 to master...

@rh-atomic-bot rh-atomic-bot changed the title Add Makefile [merged] Add Makefile Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants