[lxc-devel] [PATCH 3/3] lxc-rpm-build

Stéphane Graber stgraber at ubuntu.com
Mon Sep 10 17:53:50 UTC 2012


On 12-09-10 01:26 PM, Dwight Engen wrote:
> On Mon, 10 Sep 2012 10:36:17 -0400
> Stéphane Graber <stgraber at ubuntu.com> wrote:
> 
>> On 12-09-10 10:28 AM, Dwight Engen wrote:
>>> Expand variables to get correct paths in man pages and fix building
>>> of rpm by non-root user. Include templates in rpm, fix rpm path of
>>> lxc-init.
>>>
>>> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
>>> ---
>>>  configure.ac |    6 +++---
>>>  lxc.spec.in  |   18 ++++++++++++------
>>>  2 files changed, 15 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 70c74ec..b8d86e6 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -70,11 +70,11 @@ AC_ARG_WITH([rootfs-path],
>>>  	)], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
>>>  
>>>  AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
>>> +AS_AC_EXPAND(LXCPATH, "${with_config_path}")
>>> +AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
>>> +AS_AC_EXPAND(LXCTEMPLATEDIR, ["${datadir}/lxc/templates"])
>>>  
>>> -AC_SUBST(LXCPATH, "${with_config_path}")
>>> -AC_SUBST(LXCROOTFSMOUNT, "${with_rootfs_path}")
>>>  AC_SUBST(LXCINITDIR, ['${libexecdir}'])
>>> -AC_SUBST(LXCTEMPLATEDIR, ['/usr/share/lxc/templates'])
>>
>> This might require some matching changes to the templates and other
>> files using these variables as I believe some workarounds were put in
>> place to deal with the unexpanded variables, but I still think it's a
>> good thing and should help cleanup some code.
> 
> Could you point me to what I need to fixup? The only templates my
> grep found were lxc-altlinux.in and lxc-sshd.in and the uses there
> (of LXCPATH and LXCTEMPLATEDIR respectively) look okay to me when
> expanded vs subst.
> 
> The reason I changed them to expand was so the docs would be right
> (they had SUBST paths with ${var} still in them) but obviously I don't
> want to break code just to make the docs right :)

I'm not actually expending breakage but I'm expecting some dead code.
For example @LXCPATH@ is used in most scripts using some workarounds as
the value wasn't expanded, like:
libdir=@LIBDIR@
libexecdir=@LIBEXECDIR@
localstatedir=@LOCALSTATEDIR@

Once we apply your change, we'd have to check for such dead code and
clean it up.

>>>  AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h
>>> linux/genetlink.h], [],
>>> diff --git a/lxc.spec.in b/lxc.spec.in
>>> index da7339a..76bd291 100644
>>> --- a/lxc.spec.in
>>> +++ b/lxc.spec.in
>>> @@ -64,13 +64,13 @@ development of the linux containers.
>>>  %setup
>>>  %build
>>>  test "%{ksrc}" != "none" && args="--with-linuxdir=%{ksrc}"
>>> -PATH=$PATH:/usr/sbin:/sbin %configure $args --disable-rpath
>>> +PATH=$PATH:/usr/sbin:/sbin %configure $args --disable-rpath
>>> --with-config-path=/etc/lxc --disable-apparmor make %{?_smp_mflags}
>>
>> Why the --disable-apparmor? I believe the apparmor option has the
>> required checks in the configure to only build if you have the
>> required libraries/dev packages installed.
> 
> The configure check didn't work for me, let me look into why as that
> is the right way to do it, it should "just work".

Thanks. If the configure check is wrong, I'd rather have this fixed
rather than working around it in the packaging.

>>>  %install
>>> -%makeinstall
>>> -
>>> -find $RPM_BUILD_ROOT -type f -name '*.la' -exec rm -f {} ';'  
>>> +rm -rf %{buildroot}
>>> +make install DESTDIR=%{buildroot}
>>> +find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'  
>>>  
>>>  %clean
>>>  rm -rf %{buildroot}
>>> @@ -92,20 +92,26 @@ rm -rf %{buildroot}
>>>  %attr(4111,root,root) %{_bindir}/lxc-restart
>>>  %{_mandir}/*
>>>  %{_datadir}/doc/*
>>> +%{_datadir}/lxc/*
>>>  
>>>  %files libs
>>>  %defattr(-,root,root)
>>>  %{_libdir}/*.so.*
>>>  %{_libdir}/%{name}
>>> -%attr(4555,root,root) %{_libdir}/%{name}/lxc-init
>>> +%attr(4555,root,root) %{_libexecdir}/%{name}/lxc-init
>>>  
>>>  %files devel
>>>  %defattr(-,root,root)
>>>  %{_includedir}/%{name}/*
>>>  %{_libdir}/*.so
>>> -%{_datadir}/pkgconfig/*
>>> +%{_libdir}/pkgconfig/*
>>>  
>>>  %changelog
>>> +* Mon Sep 10 2012 Dwight Engen <dwight.engen at oracle.com> - Version
>>> 0.8.0 +- fix lxc-init moved to libexec
>>> +- .pc moved to _libdir
>>> +- package template files /usr/share/lxc/templates
>>> +
>>>  * Thu Sep  8 2011 Greg Kurz <gkurz at fr.ibm.com> - Version 0.7.5.1
>>>  - fix installed files for rpmbuild
>>>  - introduce lxc-libs package
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and 
>>> threat landscape has changed and how IT managers can respond.
>>> Discussions will include endpoint security, mobile security and the
>>> latest in malware threats.
>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________ Lxc-devel mailing
>>> list Lxc-devel at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/lxc-devel
>>>
>>
>>
> 


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20120910/ea52aee4/attachment.pgp>


More information about the lxc-devel mailing list