[opensuse-packaging] copying folder structures with install in spec file
Dear all, in the spec file I had several times the situation, where a stucture of folders and subfolders containing files needed to be copied from the the original extracted package into the structure of the programs folder to be packaged, e.g. if you have additional support files other than code/binaries. at the moment, I have to create each folder idividually in the spec file because install does not seem to support folders. A simple copy would also do, but then rights might not set correctly. I have this: dir1 |- dir1.1 : file1, file2 |-dir1.2: file10,file20 This doesn't work: %__install -m 755 dir1 %{buildroot}%{_datadir}/%{name}/ I'm sure this is an easy one for you guy's, but it keeps bugging me :-) cheers, Denny -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi Denny, On Wednesday 16 June 2010 10:18:19 am Denny Beyer wrote:
in the spec file I had several times the situation, where a stucture of folders and subfolders containing files needed to be copied from the the original extracted package into the structure of the programs folder to be packaged, e.g. if you have additional support files other than code/binaries.
at the moment, I have to create each folder idividually in the spec file because install does not seem to support folders. A simple copy would also do, but then rights might not set correctly.
I have this: dir1
|- dir1.1 : file1, file2 | |-dir1.2: file10,file20
This doesn't work: %__install -m 755 dir1 %{buildroot}%{_datadir}/%{name}/
I'm sure this is an easy one for you guy's, but it keeps bugging me :-)
"install" indeed doesn't seem to handle recursive copies, so I fear you have to do it on your own, using cp -r for the copy, followed by chown -R and chmod -R on the destination tree. -- Jean Delvare Suse L3 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wednesday 16 June 2010 10:26:22 Jean Delvare wrote:
Hi Denny,
On Wednesday 16 June 2010 10:18:19 am Denny Beyer wrote:
in the spec file I had several times the situation, where a stucture
of folders and subfolders containing files needed to be copied from the the original extracted package into the structure of the programs folder to be packaged, e.g. if you have additional support files other than code/binaries.
at the moment, I have to create each folder idividually in the spec
file because install does not seem to support folders. A simple copy would also do, but then rights might not set correctly.
I have this: dir1
|- dir1.1 : file1, file2 | |-dir1.2: file10,file20
This doesn't work: %__install -m 755 dir1 %{buildroot}%{_datadir}/%{name}/
I'm sure this is an easy one for you guy's, but it keeps bugging me
:-)
"install" indeed doesn't seem to handle recursive copies, so I fear you have to do it on your own, using cp -r for the copy, followed by chown -R and chmod -R on the destination tree.
If this is the way to go ... just wanted to make sure not missing out on something. cheers, Denny -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 06/16/2010 10:26 AM, Jean Delvare wrote:
"install" indeed doesn't seem to handle recursive copies, so I fear you have to do it on your own, using cp -r for the copy, followed by chown -R and chmod -R on the destination tree.
From man cp: -p same as --preserve=mode,ownership,timestamps --preserve[=ATTR_LIST]
Doesn't cp -pr also preserve permissions? preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all Regards Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wednesday 16 June 2010 11:38:48 Dave Plater wrote:
On 06/16/2010 10:26 AM, Jean Delvare wrote:
"install" indeed doesn't seem to handle recursive copies, so I fear you have to do it on your own, using cp -r for the copy, followed by chown -R and chmod -R on the destination tree.
Doesn't cp -pr also preserve permissions? From man cp: -p same as --preserve=mode,ownership,timestamps --preserve[=ATTR_LIST] preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all
Preserving might not necessarily help, as they might have been set incorrectly/not suitable in the first place. But thanks for your comment, will see how to use that.
Regards Dave P
cheers, Denny -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi Dave, On Wednesday 16 June 2010 11:38:48 am Dave Plater wrote:
On 06/16/2010 10:26 AM, Jean Delvare wrote:
"install" indeed doesn't seem to handle recursive copies, so I fear you have to do it on your own, using cp -r for the copy, followed by chown -R and chmod -R on the destination tree.
Doesn't cp -pr also preserve permissions? From man cp: -p same as --preserve=mode,ownership,timestamps --preserve[=ATTR_LIST] preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all Regards
This is indeed an option, however it assumes that the original files do have proper permissions. Given the upstream packages I've seen in the past with all files set as executable, it may not be a safe assumption. It is probably a good idea to use it anyway, at least for preserving the timestamps, but you may still want to enforce specific permissions with chmod -R and/or chown -R afterward. -- Jean Delvare Suse L3 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (3)
-
Dave Plater
-
Denny Beyer
-
Jean Delvare