First, I have to say that I'm new to rpm specs and I don't like this patch but I don't have better solution.

Problem:
Building the ipa rpms returns this:
warning: File listed twice: /usr/share/ipa/ui/extension.js

Cause:
This is because of a glob:
%{_usr}/share/ipa/ui/*.js

and then more specifically:
%config(noreplace) %{_usr}/share/ipa/ui/extension.js

https://fedorahosted.org/freeipa/ticket/2253

Solution thoughts::

1) best way would be limit glob like in bash ie: '%{_usr}/share/ipa/ui/!(extension).js'. It doesn't work in spec file. 2) I don't want to specify each JavaScript file in spec - would have to alter spec each time when adding new one.

--> I found nothing better than to use file list.

Filelist generation:
I'm creating it in %prep phase from install/ui/Makefile.am:
grep .js install/ui/Makefile.am | grep -v 'extension.js' | sed -e 's/[\t]*\\//' -e 's|[\t]*|%{_usr}/share/ipa/ui/|'

It would also be possible to generate the list from listing the directory:

find install/ui/ -maxdepth 1 -type f -name *.js ! -name develop.js ! -name extension.js | sed 's|^install|%{usr}/share/ipa|g'

Why from Makefile?:
The list of .js files in git and Makefile differs. Therefore listing from dir also needs to create exceptions for not used files (develop.js) - bad in long term.

--
Petr Vobornik
From 7201587ec3a151796707550d4673a0cd61b43ef1 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 14 Mar 2012 15:13:43 +0100
Subject: [PATCH] Fixed rpm build warning - extension.js listed twice

Building the ipa rpms returns this:
warning: File listed twice: /usr/share/ipa/ui/extension.js

This is because of a glob:
%{_usr}/share/ipa/ui/*.js

and then more specifically:
%config(noreplace) %{_usr}/share/ipa/ui/extension.js

https://fedorahosted.org/freeipa/ticket/2253
---
 freeipa.spec.in |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index e5089cad87a9ab12956bb758d0ff7f1b658c395d..fb1556736579867517f564e789c7ebf724dff407 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -285,6 +285,9 @@ package.
 %prep
 %setup -n freeipa-%{version} -q
 
+# Prepare Web UI JavaScript file list
+grep .js install/ui/Makefile.am | grep -v 'extension.js'  | sed -e 's/[\t]*\\//' -e 's|[\t]*|%{_usr}/share/ipa/ui/|' > serverfile.list
+
 %build
 export CFLAGS="$CFLAGS %{optflags}"
 export CPPFLAGS="$CPPFLAGS %{optflags}"
@@ -506,7 +509,7 @@ fi
 
 
 %if ! %{ONLY_CLIENT}
-%files server
+%files server -f serverfile.list
 %defattr(-,root,root,-)
 %doc COPYING README Contributors.txt
 %{_sbindir}/ipa-ca-install
@@ -563,7 +566,6 @@ fi
 %{_usr}/share/ipa/ui/logout.html
 %{_usr}/share/ipa/ui/*.ico
 %{_usr}/share/ipa/ui/*.css
-%{_usr}/share/ipa/ui/*.js
 %{_usr}/share/ipa/ui/*.eot
 %{_usr}/share/ipa/ui/*.svg
 %{_usr}/share/ipa/ui/*.ttf
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to