forked from pihhan/rpm-gitprep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.rpm-gitprep
42 lines (38 loc) · 1.5 KB
/
macros.rpm-gitprep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# gitprep specific
# Here comes the hack
%_gitprep_rpmpatch %{_libexecdir}/rpm-gitprep/rpmpatch.git
# original_value from lib
# is there way to use old %%_fixperms value without creating recursion?
%_gitprep_orig_fixperms %{__chmod} -Rf a+rX,u+w,g-w,o-w
%_gitprep_fixperms \
%{?_with_gitprep:%__scm_setup_gitprep}\
%{!?__scm:%{__scm_setup_git}} \
%{_gitprep_orig_fixperms}
%_gitprep__patch %{_gitprep_rpmpatch} --git=%{__git}
# workaround to message support
# this macros allow usage of %%autosetup -S gitprep
%__scm_setup_gitprep(q) %{__scm_setup_git %{-q}}
%__scm_apply_gitprep(qp:m:)\
%{_gitprep__patch} %{-p:-p%{-p*}} %{-m:-m %{-m*}} %{-q:-s} --fuzz=%{_default_patch_fuzz} %{_default_patch_flags} %{?1} %{?2}
# Define special handler commiting changes after sections
%___gitprep_post() \
if %{?_with_gitprep:true}%{?!_with_gitprep:test "%__scm" = gitprep} && \
test "$(%{__git} status --porcelain --untracked-files=no | wc -l)" != 0; then \
%{__git} commit -am %{1}-post \
else : \
fi \
%{nil}
%__spec_prep_post %{___gitprep_post prep} %{___build_post}
%__spec_conf_post %{___gitprep_post conf} %{___build_post}
%__spec_build_post %{___gitprep_post build} %{___build_post}
%__spec_check_post %{___gitprep_post check} %{___build_post}
%__spec_install_post\
%{?__debug_package:%{__debug_install_post}}\
%{__arch_install_post}\
%{___gitprep_post install}\
%{__os_install_post}\
%{nil}
# Add to your ~/.rpmmacros:
# %_fixperms %{_gitprep_rpmfixperms}
# %__patch %{_gitprep_rpmpatch}
# %__scm_apply_patch %{__scm_apply_gitprep}