diff options
| -rw-r--r-- | hello_cangjie_eur.spec | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/hello_cangjie_eur.spec b/hello_cangjie_eur.spec index 3da89ab..653971d 100644 --- a/hello_cangjie_eur.spec +++ b/hello_cangjie_eur.spec @@ -11,6 +11,8 @@ Requires(pre):  wget  %description  A demo for Cangjie and Eur. +%global output_name "hello_cangjie_eur" +  %global debug_package %{nil}  # 根据环境设置下载地址 @@ -106,7 +108,7 @@ do    if [ -d "$user_dir" ]; then      # 获取 .bashrc 的完整路径      bashrc="$user_dir/.bashrc" -    content="alias main='/usr/bin/%{name}'" +    content="alias main='/usr/bin/%{output_name}'"      # 检查 .bashrc 是否存在      if [ -f "$bashrc" ]; then @@ -138,8 +140,8 @@ do      # 检查 .bashrc 是否存在      if [ -f "$bashrc" ]; then -      sed -i '\|source .*/cangjie/envsetup.sh|d' "$bashrc" -      sed -i "\|alias main='/usr/bin/%{name}'|d" "$bashrc" +      sed -i '\|source %{_libdir}/cangjie/envsetup.sh|d' "$bashrc" +      sed -i "\|alias main='/usr/bin/%{output_name}'|d" "$bashrc"        source "$bashrc"      fi    fi @@ -149,7 +151,7 @@ done  %files  # %license add-license-file-here  # %doc add-docs-here -/bin/hello_cangjie_eur +/bin/%{output_name}  %exclude /.packages.toml | 
