diff options
| -rw-r--r-- | hello_cangjie_eur.spec | 27 | 
1 files changed, 25 insertions, 2 deletions
| diff --git a/hello_cangjie_eur.spec b/hello_cangjie_eur.spec index 3522782..a28293b 100644 --- a/hello_cangjie_eur.spec +++ b/hello_cangjie_eur.spec @@ -1,6 +1,6 @@  Name:           hello-cangjie-eur  Version:        0.0.8 -Release:        15%{?dist} +Release:        16%{?dist}  Summary:        Cangjie Eur demo.  License:        MIT  Source:         https://github.com/stevending1st/%{name}/archive/refs/tags/v%{version}.tar.gz @@ -51,11 +51,14 @@ cd %{_builddir}/%{buildsubdir}  source %{_builddir}/cangjie/envsetup.sh  cjpm build -o %{name} +echo "" > %{_builddir}/%{name} +  %install  cd %{_buildrootdir}/%{output_dir_name}  %{__install} -p -D -m 755 %{_builddir}/%{buildsubdir}/target/release/bin/%{name} %{_buildrootdir}/%{output_dir_name}%{_bindir}/%{name}  ln -sf %{_bindir}/%{name} .%{_bindir}/%{command} +%{__install} -p -D -m 777 %{_builddir}/%{name} %{_buildrootdir}/%{output_dir_name}%{_sysconfdir}/%{name}  %clean @@ -98,9 +101,25 @@ if [ $1 == 1 ] ; then  fi +%post +if [ $1 == 1 ] && [ -s %{_sysconfdir}/%{name} ] ; then +  if [ -z "$HELLO_CANGJIE_EUR_OUTPUT_PATH" ] ; then +    if [ -f "/var/tmp/%{name}" ]; then +      OUTPUT_PATH=$(cat /var/tmp/%{name}) +    fi +  else +    OUTPUT_PATH="$HELLO_CANGJIE_EUR_OUTPUT_PATH" +  fi + +  if [ -n "$OUTPUT_PATH" ]; then +    echo "$OUTPUT_PATH" > %{_sysconfdir}/%{name} +  fi +fi + +  %postun  if [ $1 == 0 ] ; then -  rm -rf /usr/local/lib64/%{name}/ +  rm -rf /usr/local/lib64/%{name}/ 2>/dev/null ||:    rm -f /etc/ld.so.conf.d/%{name}.conf 2>/dev/null ||:    /usr/sbin/ldconfig  fi @@ -112,9 +131,13 @@ fi  %defattr(-,root,root,-)  %{_bindir}/%{name}  %{_bindir}/%{command} +%config(noreplace) %{_sysconfdir}/%{name}  %changelog +* Fri Feb 21 2025 stevending1st <stevending1st@163.com> - 0.0.8-16 +- Add config file. +  * Thu Feb 20 2025 stevending1st <stevending1st@163.com> - 0.0.8-15  - Configure the runtime environment library; replace the method of creating executable files. | 
