Skip to content

Commit

Permalink
update .gitignore and add build instructions to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Davysson Silva committed Sep 19, 2018
1 parent f3b2a5b commit 0d14a90
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 75 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,5 @@ tmp/
__pycache__
compile_environment.yml
*.so
.vscode/*
.vscode/
dist/
54 changes: 0 additions & 54 deletions .vscode/settings.json

This file was deleted.

52 changes: 32 additions & 20 deletions README.md
Expand Up @@ -10,54 +10,66 @@ Python binding for ModSecurity

`libmodsecurity`, `python-dev` or `python3-dev` as well as `cmake`

### Packages

### Compiling with CMake
Pymodsecurity is available as an python package, to install it simply run:
```
$ pip install pymodsecurity
```

The module's shared library can be built through CMake:
### Building from source

1 - Clone this repo
2 - Update the pybind11 submodule
There are multiple ways to build pymodsecurity from source, you can either compile the module manually with CMake, install using setup.py or build a conda package using the recipe. Below are steps for each way.

#### Installing via setup.py

1 - Clone this repo and update the pybind11 submodule:
```bash
$ git submodule init && git submodule update
$ git clone --recurse-submodules https://github.com/actions-security/pymodsecurity.git
```

3 - Create a build directory
2 - Compile and install the module:
```
$ python setup.py install
```

#### Compiling with CMake

1 - Clone this repo and update the pybind11 submodule:
```bash
$ mkdir build && cd build
$ git clone --recurse-submodules https://github.com/actions-security/pymodsecurity.git
```

4 - Run cmake and make
2 - Create a build directory:
```bash
$ mkdir build && cd build
```

3 - Run CMake and make:
```bash
$ cmake .. && make
```
5 - Add the shared library to python's path
4 - Add the shared library to python's path

### Building and installing with conda
#### Building and installing with conda

If you're using conda, you can build the package locally using conda-build:

1 - Clone this repo
2 - Update the pybind11 submodule
If you're using conda, you can build the package locally using conda-build (you will need to install `conda-build`).

1 - Clone this repo and update the pybind11 submodule:
```bash
$ git submodule init && git submodule update
$ git clone --recurse-submodules https://github.com/actions-security/pymodsecurity.git
```

3 - Run conda-build

2 - Run conda-build:
```
$ conda-build recipe
```

4 - Install

3 - Install the package:
```
$ conda install --use-local pymodsecurity
```

### Examples

Some examples are provided in the `examples/` directory
Some examples are provided in the `examples/` directory. More are coming soon.

0 comments on commit 0d14a90

Please sign in to comment.