Skip to content

Commit

Permalink
Fix rpm building.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeChatP committed Sep 13, 2024
1 parent 7524316 commit 5fd0a0d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ assets = [
{ source = "target/man/fr/chsr.8.gz", dest = "/usr/share/man/fr/man8/chsr.8.gz", user = "root", group = "root", mode = "0644", doc = true }
]
post_install_script = "resources/rh/postinst.sh"
post_install_script_prog = [ "/bin/sh", "-c" ]
post_install_script_flags = 0b101

pre_uninstall_script = "resources/rh/prerm.sh"
pre_uninstall_script_prog = [ "/bin/sh", "-c" ]
pre_uninstall_script_flags = 0b101

[package.metadata.generate-rpm.requires]
pam = "*"
Expand Down
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,28 @@
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
(Do not forget to add the cargo bin directory to your PATH with `. "$HOME/.cargo/env"` command)
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* You can install git by running the following commands depending on your distribution:
Ubuntu : `sudo apt-get install git`, RedHat : `sudo yum install git`, ArchLinux : `sudo pacman -S git`
* [clang](https://clang.llvm.org/get_started.html)
* [clang](https://clang.llvm.org/get_started.html) (or gcc, but clang is highly recommended)
* You can install clang by running the following commands depending on your distribution:
Ubuntu : `sudo apt-get install clang`, RedHat : `sudo yum install clang`, ArchLinux : `sudo pacman -S clang`

Then the xtask installation will install the rest of the dependencies for you.

### How to install sr and chsr by building from source
### Install from source

1. `git clone <https://github.com/LeChatP/RootAsRole>`
1. `git clone https://github.com/LeChatP/RootAsRole`
1. `cd RootAsRole`
1. `cargo xtask install -bip sudo`

Or you can use deb or rpm packages and install them with apt or rpm commands.

### Install from precompiled binaries

You can download the precompiled binaries from the [release page](https://github.com/LeChatP/RootAsRole/releases).

Then you can install the package with the following commands:

```sh
sudo apt install rootasrole_3.0.0_amd64.deb
Expand Down Expand Up @@ -176,16 +183,14 @@ This doesn't mean that earlier versions of these distributions are incompatible;
## Contributors
Ahmad Samer Wazan : <[email protected]>
Eddie Billoir : <[email protected]>
Ahmad Samer Wazan : <[email protected]>
Rémi Venant: <[email protected]>
Guillaume Daumas : <[email protected]>
Eddie Billoir : <[email protected]>
Anderson Hemlee : <[email protected]>
Romain Laborde : <[email protected]>
## About Logo
Expand Down
3 changes: 2 additions & 1 deletion resources/rh/postinst.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if [[ -z ${SUDO_USER+x} ]]; then INSTALL_USER=`id -urn`; else INSTALL_USER=$SUDO_USER; fi
#!/bin/sh
if [ -z ${SUDO_USER+x} ]; then INSTALL_USER=$(id -urn); else INSTALL_USER=$SUDO_USER; fi

filesystem() {
df -T "$1" | awk 'NR==2 {print $2}'
Expand Down
2 changes: 1 addition & 1 deletion resources/rh/prerm.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
chattr -i /etc/security/rootasrole.json || true
chattr -i /etc/security/rootasrole.json 2>/dev/null || true

0 comments on commit 5fd0a0d

Please sign in to comment.