Skip to content

Commit

Permalink
nix package
Browse files Browse the repository at this point in the history
  • Loading branch information
staskobzar committed Apr 4, 2024
1 parent fc40216 commit 7e8f272
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
- name: Install
run: |
sudo apt-get -qq update
sudo apt-get -y --no-install-recommends install build-essential automake ncurses-dev cmake libcmocka0 git pkg-config autoconf libterm-ui-perl libasound2-dev libalsaplayer-dev openssl libssl-dev apt-utils xterm
sudo apt-get -y install curl ncurses-dev libsctp-dev libpcap-dev ca-certificates sip-tester
git clone -b 2.7.x --depth 1 https://github.com/pjsip/pjproject.git
cd pjproject && ./configure --prefix=/usr && make dep && make && sudo make install
sudo apt-get -y --no-install-recommends install build-essential automake ncurses-dev cmake libcmocka0 zip pkg-config autoconf libterm-ui-perl libasound2-dev libalsaplayer-dev openssl libssl-dev apt-utils xterm
sudo apt-get -y install curl ncurses-dev libsctp-dev libpcap-dev ca-certificates sip-tester wget
wget https://github.com/pjsip/pjproject/archive/refs/tags/2.14.1.zip
unzip 2.14.1.zip
cd pjproject-2.14.1 && ./configure --prefix=/usr && make dep && make && sudo make install
- name: Build
run: make
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
dist/nix/result

CMakeCache.txt
CMakeFiles
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Can be useful for SIP administrators and developers.
<img src="https://github.com/staskobzar/sippak/blob/master/sippak.png?raw=true" width="600"/>
</p>

### Usage examples
> Ping remote server with SIP NOTIFY message
## Usage examples
> Ping remote server with SIP OPTIONS message
```
sippak --color PING sip:1001@DOMAIN_OR_IP
```
Expand Down Expand Up @@ -60,15 +60,22 @@ sippak notify --event=check-sync sip:1000@192.168.1.148 --color
sippak MESSAGE --body="Hello there" --header="X-Token: f7c0265e" --color sip:1001@DOMAIN_OR_IP
```

### Install
## Install

### make
Requires pjproject library and CMake 3.

```
make
sudo make install
```
CMake will require pkg-config path to libpjproject. If it has custom path
it can be provided with PKG_CONFIG_PATH variable. For example:
```
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig make
```

### Ubuntu
Also, packages (rpm, deb and tgz) are available in "[dist](https://github.com/staskobzar/sippak/tree/master/dist)" directory.

Here is step by step install example for Ubuntu. Note version 2.7.x of pjproject. This will install everything for deployement and development. "make test" is optional.
Expand All @@ -88,7 +95,16 @@ $ make test
$ make install
```

### Try with docker without installing
### nix package
Nix package is available in ```dist/nix/```. Inside this folder run

``` sh
nix-build
```

binary file will be available in ```result/bin```

## Try with docker without installing

```
docker pull staskobzar/sippak
Expand All @@ -103,7 +119,7 @@ docker run -ti sippak sippak --help
```


### Usage
## Usage

```
sippak [COMMAND] [OPTIONS] [DESTINATION]
Expand Down
7 changes: 7 additions & 0 deletions dist/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";
pkgs = import nixpkgs {
config = { };
overlays = [ ];
};
in { sippak = pkgs.callPackage ./sippak.nix { }; }
22 changes: 22 additions & 0 deletions dist/nix/sippak.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ stdenv, lib, fetchzip, cmake, pjsip, cmocka, dbus, pkg-config, }:

stdenv.mkDerivation {
pname = "sippak";
version = "1.1.0";

src = fetchzip {
url = "https://github.com/staskobzar/sippak/archive/refs/tags/v1.1.0.zip";
sha256 = "sha256-B9aANfpdYzUN5hm4NvPNcXi/iSQSTjNfLoKUpyNvTKk=";
};

buildInputs = [ pjsip cmocka cmake dbus ];

nativeBuildInputs = [ pkg-config ];

buildPhase = ''
runHook preInstall
make
make install
runHook postInstall
'';
}
Binary file modified dist/sippak-1.1.0-beta-Linux.deb
Binary file not shown.
Binary file modified dist/sippak-1.1.0-beta-Linux.rpm
Binary file not shown.
Binary file modified dist/sippak-1.1.0-beta-Linux.tar.gz
Binary file not shown.

0 comments on commit 7e8f272

Please sign in to comment.