Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-project
Commits
3fe14479
Unverified
Commit
3fe14479
authored
4 years ago
by
Maxim Cournoyer
Browse files
Options
Downloads
Patches
Plain Diff
streamline jami-all.postinst file
Change-Id: I8bbb844c44a21b24574ca59b59dffd7c97f640de
parent
a966d8c6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packaging/rules/fedora/jami-all.postinst
+43
-54
43 additions, 54 deletions
packaging/rules/fedora/jami-all.postinst
with
43 additions
and
54 deletions
packaging/rules/fedora/jami-all.postinst
+
43
−
54
View file @
3fe14479
...
...
@@ -14,11 +14,6 @@
# [1] Configuration #
###############################################################################
# All package repo urls are expected to start with this string, regardless
# of the distribution or version. The end tag is automatically appended,
# depending on the system the postinst script is run on.
#
# To update the appended end tags, modify the switch in [2].
JAMI_REPO_BASE
=
"https://dl.jami.net/nightly"
# Jami release key.
...
...
@@ -68,66 +63,60 @@ HUFCGSHO3/kzxSlkE1PBUX3IZ8PSFijyopBnWUhlSXuyRjte8OR7Fl/Rlf0IaOD1
# postrm paths should be modified as well
YUM_FILE
=
"/etc/yum.repos.d/jami-main.repo"
GPG_FILE
=
"/etc/pki/rpm-gpg/RPM-GPG-KEY-JAMI"
JAMI_UPDATE_MANAGER_ID
=
"jami"
JAMI_UPDATE_MANAGER_CFG
=
"
${
JAMI_UPDATE_MANAGER_ID
}
.cfg"
###############################################################################
# [2] Set package repo url depending on distribution and version #
###############################################################################
is_distribution_supported
()
{
CAN_ADD_YUM_SOURCE
=
true
# Detect currently running system using /etc/os-release
# Redhat-based systems are supposed to provide /etc/os-release so
# if it's not the case then we simply don't want to provide
# automatic updates.
if
!
[
-f
/etc/os-release
]
;
then
return
1
fi
# Detect currently running system using /etc/os-release
# Redhat-based systems are supposed to provide /etc/os-release so if it's not
# the case then we simply don't want to provide automatic updates
if
[
-f
/etc/os-release
]
;
then
# This defines variables such as NAME, ID, VERSION_ID, etc.
.
/etc/os-release
JAMI_REPO
=
'
[jami]
name='
"
${
NAME
}
"
' $releasever - $basearch - Jami
baseurl='
"
${
JAMI_REPO_BASE
}
"
/
"
${
ID
}
"
'_$releasever
gpgcheck=1
gpgkey=https://dl.jami.net/jami.pub.key
enabled=1'
# Set-up Jami repository end tag
if
[
"
${
PLATFORM_ID
}
"
=
"platform:el8"
]
||
[
"
${
ID
}
_
${
VERSION_ID
%.*
}
"
=
"rhel_8"
]
;
then
ENDTAG
=
"rhel_8"
elif
[
"
${
PLATFORM_ID
}
"
=
"platform:f32"
]
||
[
"
${
ID
}
_
${
VERSION_ID
}
"
=
"fedora_32"
]
;
then
ENDTAG
=
"fedora_32"
elif
[
"
${
PLATFORM_ID
}
"
=
"platform:f33"
]
||
[
"
${
ID
}
_
${
VERSION_ID
}
"
=
"fedora_33"
]
;
then
ENDTAG
=
"fedora_33"
else
# Distribution is not supported. Don't provide automatic updates.
CAN_ADD_YUM_SOURCE
=
false
fi
else
CAN_ADD_YUM_SOURCE
=
false
fi
case
${
ID
}
_
${
VERSION_ID
%.*
}
in
rhel_8|fedora_32|fedora_33
)
return
0
;;
esac
return
1
}
###############################################################################
# [3] Maintainer script main switch #
###############################################################################
if
[
"
`
command
-v
rpm
`
"
=
""
]
;
then
# we can only add key if rpm is present
CAN_ADD_YUM_SOURCE
=
false
fi
if
is_distribution_supported
;
then
CAN_ADD_YUM_SOURCE
=
true
else
CAN_ADD_YUM_SOURCE
=
false
fi
if
command
-v
rpm
>
/dev/null
;
then
# RPM is required to add the key.
CAN_ADD_YUM_SOURCE
=
false
fi
if
[
"
${
CAN_ADD_YUM_SOURCE
}
"
=
"true"
]
;
then
# # We first add the key to the trusted keyring.
cat
>
$GPG_FILE
<<
EOF
$JAMI_KEY
EOF
/usr/bin/rm
-f
/var/lib/rpm/.rpm.lock
>
/dev/null 2>&1
/usr/bin/rpm
--import
$GPG_FILE
>
/dev/null 2>&1
if
[
"
${
CAN_ADD_YUM_SOURCE
}
"
=
"true"
]
;
then
# Add the key to the trusted keyring.
echo
"
$JAMI_KEY
"
>
"
$GPG_FILE
"
# Add an entry for the package repository to the trusted package
cat
>
$YUM_FILE
<<
EOF
$JAMI_REPO
rm
-f
/var/lib/rpm/.rpm.lock
>
/dev/null 2>&1
rpm
--import
"
$GPG_FILE
"
>
/dev/null 2>&1
# Add an entry for the package repository to the trusted package.
# XXX: The NAME and ID variables are set as a side-effect of
# sourcing the /etc/os-release file in the above
# is_distribution_supported call.
cat
>
"
$YUM_FILE
"
<<
EOF
[jami]
name=
$NAME
\$
releasever -
\$
basearch - Jami
baseurl=
${
JAMI_REPO_BASE
}
/
${
ID
}
_
\$
releasever
gpgcheck=1
gpgkey=https://dl.jami.net/jami.pub.key
enabled=1
EOF
fi
exit
0
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment