Accepting request 637097 from home:bmwiedemann:branches:Documentation:Tools

- Drop build date from build output (boo#1047218)
- Fix % escaping where %H:%M:%S turned into 17:53:56OURCE

For Leap/SLE 15.0 and later, the whole sigil-gt-0.9.0-Dialogs-About.cpp.patch
could be dropped because OBS+gcc already normalize __DATE__ and __TIME__
to the latest changelog date.

sed calls had to be moved down to not update ChangeLog.txt mtime.

OBS-URL: https://build.opensuse.org/request/show/637097
OBS-URL: https://build.opensuse.org/package/show/Documentation:Tools/sigil?expand=0&rev=25
This commit is contained in:
Dirk Stoecker 2018-09-21 19:27:34 +00:00 committed by Git OBS Bridge
parent beeeabd38a
commit 94f520bea7
2 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 21 18:47:29 UTC 2018 - Bernhard Wiedemann <bwiedemann@suse.com>
- Drop build date from build output (boo#1047218)
- Fix % escaping where %H:%M:%S turned into 17:53:56OURCE
-------------------------------------------------------------------
Thu Aug 16 09:10:33 UTC 2018 - jengelh@inai.de

View File

@ -86,26 +86,27 @@ specification and create a hierarchical Table of Contents.
%prep
%setup -q -n Sigil-%{version}
sed -i 's/\r//' ChangeLog.txt README.md COPYING.txt
%patch0 -p 1
cp -v %{S:1} .
cp -v %{S:2} .
# rpmlint
dos2unix src/Resource_Files/python3lib/meta*.py
dos2unix src/Resource_Files/python3lib/opf_*.py
find . -type f -exec sed -i -e 's|#!\/usr\/bin\/env python|#!\/usr\/bin\/python3|g' {} +
#FIXME MANUAL UPDATE OF DATE REQUIRED HERE!!!!
# Fix "Your file uses __DATE and __TIME__ this causes the package to rebuild
# when not needed warning"
# http://sourceforge.net/tracker/?func=detail&atid=102439&aid=3314371&group_id=2439
#
# We use the current date
_date=$(date +"%Y%m%d")
_time=$(date +"%H:%M:%S")
# We use the ChangeLog date
_date=$(date -u -r ChangeLog.txt -I)
_time=$(date -u -r ChangeLog.txt +%%T)
# Change it:
find . -type f -name About.cpp -exec sed -i "s/@DATE@/$_date/;s/@TIME@/$_time/g" {} +
sed -i 's/\r//' ChangeLog.txt README.md COPYING.txt
dos2unix src/Resource_Files/python3lib/meta*.py
dos2unix src/Resource_Files/python3lib/opf_*.py
find . -type f -exec sed -i -e 's|#!\/usr\/bin\/env python|#!\/usr\/bin\/python3|g' {} +
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"