Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update brew formulae, READMEs #362

Merged
5 commits merged into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ YDK-Py requires ydk-cpp core to be built and installed.
####Linux
Ubuntu (Debian-based): The following packages must be present in your system before installing YDK-Py:
```
$ sudo apt-get install python-pip zlib1g-dev python-lxml libxml2-dev libxslt1-dev python-dev libboost-dev libboost-python-dev libssh-dev libcurl4-openssl-dev libtool-bin
$ sudo apt-get install python-pip zlib1g-dev python-lxml libxml2-dev libxslt1-dev python-dev libboost-dev libboost-python-dev libssh-dev libcurl4-openssl-dev libtool-bin libboost-all-dev libboost-log-dev libpcre3-dev libpcre++-dev libtool pkg-config python3-dev python3-lxml cmake
```

Centos (Fedora-based): The following packages must be present in your system before installing YDK-Py:
```
$ sudo yum install epel-release
$ sudo yum install python-pip python-devel libxml2-devel libxslt-devel libssh-devel boost-devel boost-python libcurl-devel libtool gcc-c++
$ sudo yum install python-pip python-devel libxml2-devel libxslt-devel libssh-devel boost-devel boost-python libcurl-devel libtool gcc-c++ cmake
```

####Mac
Expand Down
203 changes: 203 additions & 0 deletions sdk/cpp/install/Debian/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
#Getting Set Up
<a href="http://packaging.ubuntu.com/html/getting-set-up.html">http://packaging.ubuntu.com/html/getting-set-up.html</a>

Install basic packaging software
```
$ sudo apt-get install gnupg pbuilder ubuntu-dev-tools bzr-builddeb apt-file
$ sudo apt-get install packaging-dev
```

Create your GPG key
```
$ gpg --gen-key
```
The default key type (RSA and DSA) is fine.

The default key size (currently 2048) is fine.

Setting the key expiration to 0 (never) is fine.

Enter your name.

Enter your email address.

Set a passphrase.
```
$ gpg --send-keys --keyserver keyserver.ubuntu.com <KEY ID>
```
pub aaaaa/xxxxxxxx yyyy-mm-dd

Key ID is xxxxxxxx

Create your SSH key
```
$ ssh-keygen -t rsa
```

Upload your SSH key to Launchpad

Follow instructions at <a href="https://launchpad.net/~/+editsshkeys">https://launchpad.net/~/+editsshkeys</a>

Set up pbuilder
```
$ pbuilder-dist xenial create
```

Upload your GPG key to Launchpad
```
gpg --fingerprint <EMAIL>
```
Copy the Key Fingerprint (xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx) into the text box at <a href="https://launchpad.net/~/+editpgpkeys">https://launchpad.net/~/+editpgpkeys</a>

Check your email account and read the email that Launchpad sent you and decrypt it using GPG

Configure Bazaar
```
$ bzr whoami "<NAME> <<EMAIL>>"
$ bzr launchpad-login <LAUNCHPAD ACCOUNT>
```
eg.
```
$ bzr whoami "Bob Bacon (BB) <BBacon@cisco.com>"
$ bzr launchpad-login ydk
```

Configure your shell
```
export DEBFULLNAME="<NAME>"
export DEBEMAIL="<EMAIL>"
```
eg.
```
export DEBFULLNAME="Bob Bacon (BB)"
export DEBEMAIL="BBacon@cisco.com"
```

#Packaging
<a href="http://packaging.ubuntu.com/html/packaging-new-software.html">http://packaging.ubuntu.com/html/packaging-new-software.html</a>

Install build tools
```
$ sudo apt-get install build-essential
$ sudo apt-get install dh-make bzr-builddeb
```

Download main package
```
$ wget -O ydk-0.5.2.tar.gz "https://github.com/CiscoDevNet/ydk-cpp/archive/0.5.2.tar.gz"
```

Make sure it works by following the guide at
<a href="https://github.com/CiscoDevNet/ydk-cpp/blob/master/README.md">https://github.com/CiscoDevNet/ydk-cpp/blob/master/README.md</a>

Start Package
```
$ bzr dh-make ydk 0.5.2 ydk-0.5.2.tar.gz
```
Package type is l for library
Verify information is correct

##Customize Debian Files

Remove the optional example files
```
$ cd ydk/debian
$ rm *ex *EX
```

***Debian/changelog***

Ubuntu version is 0.5.2-0ubuntu1 (upstream version 0.5.2, Debian version 0, Ubuntu version 1)

Change unstable to current development release (xenial)

***Debian/control***

first paragraph describes the source package

second and following paragraphs describe the packages to be built
```
Build-Depends: debhelper (>=9), libboost-all-dev, libcurl4-openssl-dev, libpcre3-dev, libssh-dev, libxml2-dev, libxslt1-dev, libtool-bin, cmake (>=3), git, pkg-config
```
fill in a description of the program

***Debian/copyright***

fill in to follow the licence of the upstream source

***Debian/docs***

any upstream documentation files you think should be included in the final package

***README.source*** and ***README.Debian***

only needed if your package has any non-standard features

***Debian/source/format***
```
3.0 (quilt)
```

***Debian/rules***

a Makefile which compiles the code using debhelper 7 (mostly automated)

Commit the code to your packaging branch
```
$ bzr add debian/source/format
$ bzr commit -m "Initial commit of Debian packaging."
```
##Build Package
Build Package
```
$ bzr builddeb -- -us -uc
```

Generate source.changes File
```
$ bzr builddeb -S
```
packages and source.changes output to one directory above and thus outside the project

##Confirm Package

View Contents
```
$ cd ../..
$ lesspipe ydk_0.5.2-0ubuntu1_amd64.deb
```

Install
```
$ sudo dpkg --install ydk_0.5.2-0ubuntu1_amd64.deb
```

Uninstall
```
$ sudo apt-get remove ydk
```

Build on a clean system
```
$ cd build-area
$ pbuilder-dist <UBUNTU RELEASE> build ydk_0.5.2-0ubuntu1.dsc
```
eg.
```
$ pbuilder-dist xenial build ydk_0.5.2-0ubuntu1.dsc
```

Upload branch to launchpad
```
$ bzr push lp:~<LP USERNAME>/+junk/ydk-package
```
Set up a PPA in Launchpad
```
https://launchpad.net/~<LP USERNAME>
```

Upload PPA with dput
```
$ dput ppa:<LP USERNAME>/<PPA NAME> <SOURCE.CHANGES>
```
use -f or remove .upload file to push updates to this package
41 changes: 41 additions & 0 deletions sdk/cpp/install/osx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Refer to https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md

Install ydk core
```
$ brew install ydk
```

Test ydk core
```
$ brew test ydk
```

Install ietf bundle
```
$ brew install ydk-ietf
```

Test ietf bundle
```
$ brew test ydk-ietf
```

Install openconfig bundle
```
$ brew install ydk-openconfig
```

Test openconfig bundle
```
$ brew test ydk-openconfig
```

Install cisco ios xr bundle
```
$ brew install ydk-cisco-ios-xr
```

Test cisco ios xr bundle
```
$ brew test ydk-cisco-ios-xr
```
10 changes: 8 additions & 2 deletions sdk/cpp/install/osx/ydk-cisco-ios-xr.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
class YdkCiscoIosXr < Formula
desc "generate API bindings to YANG data models"
homepage "https://github.com/abhikeshav/ydk-cpp/blob/master/README.md"
homepage "https://github.com/CiscoDevNet/ydk-cpp/blob/master/README.md"
url "https://github.com/CiscoDevNet/ydk-cpp/archive/0.5.2.tar.gz"
sha256 "39ca26b57e0d784243ebd0c07eb0e35fc0ad8600886fde2be4440eae898b844d"

depends_on "ydk"
depends_on "ydk-ietf"
depends_on "ydk-openconfig"
depends_on "cmake" => :build
depends_on "boost"
depends_on "boost-python"
depends_on "pkg-config" => :build
depends_on "curl"
depends_on "libssh"
depends_on "pcre"
depends_on "xml2"
depends_on "pkg-config" => :build
depends_on :x11 => :optional

def install
Expand Down
17 changes: 14 additions & 3 deletions sdk/cpp/install/osx/ydk-ietf.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
class YdkIetf < Formula
desc "generate API bindings to YANG data models"
homepage "https://github.com/abhikeshav/ydk-cpp/blob/master/README.md"
homepage "https://github.com/CiscoDevNet/ydk-cpp/blob/master/README.md"
url "https://github.com/CiscoDevNet/ydk-cpp/archive/0.5.2.tar.gz"
sha256 "39ca26b57e0d784243ebd0c07eb0e35fc0ad8600886fde2be4440eae898b844d"

depends_on "ydk"
depends_on "cmake" => :build
depends_on "boost"
depends_on "boost-python"
depends_on "pkg-config" => :build
depends_on "curl"
depends_on "libssh"
depends_on "pcre"
depends_on "xml2"
depends_on "pkg-config" => :build
depends_on :x11 => :optional

def install
Expand All @@ -23,6 +27,13 @@ def install
end

test do
system "brew", "ls", "--versions", "ydk-ietf"
(testpath/"test.cpp").write <<-EOS.undent
#include <ydk_ietf/ietf_interfaces.hpp>
int main() {
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "-Wall", "-Wextra", "-g", "-O0", "test.cpp", "-otest", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_thread-mt", "-lboost_date_time-mt", "-lboost_system-mt", "-lboost_filesystem-mt", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_thread-mt", "-lboost_date_time-mt", "-lboost_system-mt", "-lboost_filesystem-mt", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_filesystem-mt", "-lboost_system-mt", "-lxml2", "-lcurl", "-lssh_threads", "-lpcre", "-lxslt", "-lssh", "-lpthread", "-ldl", "-lydk"
system "./test"
end
end
18 changes: 15 additions & 3 deletions sdk/cpp/install/osx/ydk-openconfig.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
class YdkOpenconfig < Formula
desc "generate API bindings to YANG data models"
homepage "https://github.com/abhikeshav/ydk-cpp/blob/master/README.md"
homepage "https://github.com/CiscoDevNet/ydk-cpp/blob/master/README.md"
url "https://github.com/CiscoDevNet/ydk-cpp/archive/0.5.2.tar.gz"
sha256 "39ca26b57e0d784243ebd0c07eb0e35fc0ad8600886fde2be4440eae898b844d"

depends_on "ydk"
depends_on "ydk-ietf"
depends_on "cmake" => :build
depends_on "boost"
depends_on "boost-python"
depends_on "pkg-config" => :build
depends_on "curl"
depends_on "libssh"
depends_on "pcre"
depends_on "xml2"
depends_on "pkg-config" => :build
depends_on :x11 => :optional

def install
Expand All @@ -23,6 +28,13 @@ def install
end

test do
system "brew", "ls", "--versions", "ydk-openconfig"
(testpath/"test.cpp").write <<-EOS.undent
#include <ydk_openconfig/openconfig_bgp_policy.hpp>
int main() {
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "-Wall", "-Wextra", "-g", "-O0", "test.cpp", "-otest", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_thread-mt", "-lboost_date_time-mt", "-lboost_system-mt", "-lboost_filesystem-mt", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_thread-mt", "-lboost_date_time-mt", "-lboost_system-mt", "-lboost_filesystem-mt", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_filesystem-mt", "-lboost_system-mt", "-lxml2", "-lcurl", "-lssh_threads", "-lpcre", "-lxslt", "-lssh", "-lpthread", "-ldl", "-lydk"
system "./test"
end
end
15 changes: 13 additions & 2 deletions sdk/cpp/install/osx/ydk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ class Ydk < Formula
depends_on "cmake" => :build
depends_on "boost"
depends_on "boost-python"
depends_on "pkg-config" => :build
depends_on "curl"
depends_on "libssh"
depends_on "pcre"
depends_on "xml2"
depends_on "pkg-config" => :build
depends_on :x11 => :optional

def install
Expand All @@ -22,6 +25,14 @@ def install
end

test do
system "brew", "ls", "--versions", "ydk"
(testpath/"test.cpp").write <<-EOS.undent
#include <ydk/path_api.hpp>
int main() {
ydk::path::Repository repo{};
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "-Wall", "-Wextra", "-g", "-O0", "test.cpp", "-otest", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_thread-mt", "-lboost_date_time-mt", "-lboost_system-mt", "-lboost_filesystem-mt", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_thread-mt", "-lboost_date_time-mt", "-lboost_system-mt", "-lboost_filesystem-mt", "-lboost_log_setup-mt", "-lboost_log-mt", "-lboost_filesystem-mt", "-lboost_system-mt", "-lxml2", "-lcurl", "-lssh_threads", "-lpcre", "-lxslt", "-lssh", "-lpthread", "-ldl", "-lydk"
system "./test"
end
end