Permalink
Browse files

Merge pull request #49 from antwal/master

Updates
  • Loading branch information...
haakonnessjoen committed Nov 14, 2018
2 parents 70823b9 + f653966 commit db80dc7fcc7ebf7f85f511e381445ba521c4eae6
@@ -0,0 +1,60 @@
#!/bin/sh -xe
# Clean the yum cache
yum -y clean all
yum -y clean expire-cache
yum -y groupinstall 'Development Tools'
gcc --version
# TODO: Check for git tags, deploy RPM only on release
# Prepare the RPM environment
mkdir -p /tmp/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
# Macros - /etc/rpm/macros.dist
cat >> /etc/rpm/macros.dist << EOF
%dist .centos.el7
%mactelnet 1
EOF
# Copy SPEC file
cp MAC-Telnet/config/mactelnet.spec /tmp/rpmbuild/SPECS
# Get latest version of release
package_version=`grep Version MAC-Telnet/config/mactelnet.spec | awk '{print $2}'`
# Create source archive for RPM Build
pushd MAC-Telnet
git archive --prefix=mactelnet-${package_version}/ HEAD | gzip > /tmp/rpmbuild/SOURCES/mactelnet-${package_version}.tar.gz
popd
# Build RPM
rpmbuild --define '_topdir /tmp/rpmbuild' -ba -vv /tmp/rpmbuild/SPECS/mactelnet.spec
# After building the RPM, try to install it
# Fix the lock file error on EL7. /var/lock is a symlink to /var/run/lock
mkdir -p /var/run/lock
# Testing packages
yum localinstall -y /tmp/rpmbuild/RPMS/x86_64/mactelnet-*
#
# TODO: Removed for testing rpm builder
#
# Source repo version
#pushd MAC-Telnet
# Test build
#./autogen.sh
#make all
#
# TODO: Fix packages
# Extract rpm -> rpm2cpio ./mactelnet-client-0.4.4-1.centos.el7.x86_64.rpm | cpio -idmv
# rpm2cpio ./mactelnet-daemon-0.4.4-1.centos.el7.x86_64.rpm | cpio -idmv
#
# TODO: mactelnet-client, remove man1/mactelnetd.1
# TODO: mactelnet-daemon, remove man1/macping.1, man1/mactelnet.1, man1/mndp.1
#
@@ -0,0 +1,4 @@
- **MAC Telnet version:**
- **Operating system and architecture:**
- **Issue**
- **Log**
@@ -1,4 +1,5 @@
.DS_Store
.idea
ABOUT-NLS
ChangeLog
autom4te.cache
@@ -24,8 +25,13 @@ config.status
configure
configure.scan
po/Makevars.template
/po/POTFILES
/po/*.gmo
/po/*.po~
/po/*.pot
src/macping
src/mactelnet
src/mactelnetd
src/mndp
src/.deps/
src/config.h
@@ -6,19 +6,31 @@ matrix:
include:
- os: linux
dist: trusty
env: OSNAME="linux"
env: OS_NAME="linux"
# Linux Ubuntu Trusty
- os: osx
osx_image: xcode9
env: OSNAME="osx" OSVERSION="10.13" OSBUILD="brew"
env: OS_NAME="osx" OS_VERSION="10.13" OS_BUILD="brew"
# Apple OSX 10.13 High Sierra
- os: osx
osx_image: xcode8.3
env: OSNAME="osx" OSVERSION="10.12" OSBUILD="brew"
env: OS_NAME="osx" OS_VERSION="10.12" OS_BUILD="brew"
# Apple OSX 10.12 Sierra
- os: osx
osx_image: xcode8
env: OSNAME="osx" OSVERSION="10.11" OSBUILD="brew"
env: OS_NAME="osx" OS_VERSION="10.11" OS_BUILD="brew"
# Apple OSX 10.11 El Capitan
- os: osx
osx_image: xcode6.4
env: OSNAME="osx" OSVERSION="10.10 10.9" OSBUILD="sources"
env: OS_NAME="osx" OS_VERSION="10.10 10.9" OS_BUILD="sources"
# Apple OSX 10.10 Yosemite
# Apple OSX 10.9 Mavericks
- os: linux
dist: trusty
sudo: required
env: OS_NAME="centos" OS_VERSION="7" OS_BUILD="rpmbuilder"
services: docker
# DOCKER CentOS 7
compiler: gcc
@@ -41,13 +53,28 @@ addons:
- gettext
before_install:
- ./.travis/install-gettext.sh
- chmod a+x ./.travis/before_install.sh
- ./.travis/before_install.sh
script:
- ./autogen.sh
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./configure --disable-nls; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./configure; fi
- make all
- chmod a+x ./.travis/script.sh
- ./.travis/script.sh
#after_success:
# - .travis/after_success.sh
after_script:
after_script:
- set +e
# Deploy Release Package
#deploy:
# provider: releases
# api_key:
# secure:
# file:
# skip_clean: true
# on:
# repo: haakonnessjoen/MAC-Telnet
# tags: true
@@ -4,15 +4,26 @@ set -e
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
sudo apt-get update
sudo apt-get install -y gettext autopoint
if [[ $OS_NAME == 'linux' ]]; then
sudo apt-get update
sudo apt-get install -y gettext autopoint
elif [[ $OS_NAME == 'centos' ]]; then
sudo apt-get update
echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
sudo service docker restart
sleep 5
sudo docker pull centos:centos${OS_VERSION}
fi
fi
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
case "${OSBUILD}" in
case "${OS_BUILD}" in
brew)
# Install some custom requirements on OS X from brew
# Force update homebrew
@@ -86,3 +97,4 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
esac
fi
@@ -0,0 +1,29 @@
#!/bin/bash
set -e
if [[ $OS_NAME == 'centos' ]]; then
# TODO: Add to docker folder for RPMs
docker run --privileged -d -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup -v `pwd`:/MAC-Telnet:rw centos:centos${OS_VERSION} /usr/sbin/init
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
docker logs $DOCKER_CONTAINER_ID
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -c "bash -xe /MAC-Telnet/.docker/centos7.sh;
echo -ne \"------\nEND MAC-Telnet TESTS\n------\nSystemD Units:\n------\n\";
systemctl --no-pager --all --full status;
echo -ne \"------\nJournalD Logs:\n------\n\";
journalctl --catalog --all --full --no-pager;"
docker ps -a
docker stop $DOCKER_CONTAINER_ID
docker rm -v $DOCKER_CONTAINER_ID
else
# OSX, Linux, FreeBSD
./autogen.sh
make all
fi
@@ -20,6 +20,21 @@ Note that Docker runs containers on isolated internal networks by default. [`--n
See [Usage](#usage) for more.
### CentOS 7 ###
To install dependencies:
yum -y install wget automake gettext gettext-devel gcc make
Download source tarball, extract, compile and install:
wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz
tar zxvf mactelnet.tar.gz
cd haakonness*/
./autogen.sh
make all install
### Linux / kfreebsd ###
Dependencies: gcc (or similar), automake, autoconf
@@ -34,7 +49,6 @@ Download source tarball, extract, compile and install:
tar zxvf mactelnet.tar.gz
cd haakonness*/
./autogen.sh
./configure
make all install
### FreeBSD ###
@@ -69,7 +83,6 @@ Install dependencies, download source tarball, extract, compile and install:
export PATH=/usr/local/opt/gettext/bin:$PATH
./autogen.sh
./configure --disable-nls
make all install
And you are ready..
@@ -119,7 +132,6 @@ Install dependencies, download source tarball, extract, compile and install:
tar zxf mactelnet.tar.gz
cd haakonness*/
./autogen.sh
./configure --disable-nls
make all
sudo make install
@@ -1,5 +1,35 @@
#! /bin/sh
aclocal -I m4 \
&& autoreconf -i \
&& automake --gnu --add-missing
# Clean All
if [ "$1" = "clean" ]; then
make clean
rm -f aclocal.m4 compile configure install-sh \
depcomp ltmain.sh config.guess config.sub \
`find . -name Makefile.in` compile `find . -name Makefile`
rm -rf autom4te.cache
rm -rf src/.deps
exit
fi
aclocal -I m4
autoreconf -i
automake --gnu --add-missing
autoconf
case "$OSTYPE" in
darwin*)
LDFLAGS=${LDFLAGS=-lintl}
export LDFLAGS
;;
linux*)
echo "LINUX"
;;
bsd*)
echo "BSD"
;;
*)
echo "unknown: $OSTYPE"
;;
esac
./configure "$@"
@@ -0,0 +1,71 @@
Name: mactelnet
Version: 0.4.4
Release: 1%{?gitrev:.%{gitrev}git}%{?dist}
Summary: Console tools for connecting to, and serving, devices using MikroTik RouterOS MAC-Telnet protocol.
Epoch: 7
License: GNU
Group: Applications/System
URL: http://lunatic.no/2010/10/routeros-mac-telnet-application-for-linux-users/
# Generated with:
# git archive --prefix=%{name}-%{version}/ v%{version} | gzip > %{name}-%{version}.tar.gz
#
# Pre-release build tarballs should be generated with:
# git archive --prefix=%{name}-%{version}/ %{gitrev} | gzip > %{name}-%{version}-%{gitrev}.tar.gz
#
Source0: %{name}-%{version}%{?gitrev:-%{gitrev}}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%define _prefix /usr/local
%description
%{summary}
%package daemon
Group: Applications/System
Summary: Testing
BuildRequires: redhat-rpm-config
%description daemon
%{summary}
%package client
Group: Applications/System
Summary: Testing
BuildRequires: redhat-rpm-config
%description client
%{summary}
%prep
%setup -q
%build
./autogen.sh
make all
%clean
rm -rf $RPM_BUILD_ROOT
%install
make DESTDIR=$RPM_BUILD_ROOT install
%files client
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/*
%doc %{_prefix}/share/*
%files daemon
%defattr(-,root,root,-)
%config(noreplace) %{_prefix}/%{_sysconfdir}/mactelnetd.users
%attr(755,root,root) %{_sbindir}/*
%doc %{_prefix}/share/*
Oops, something went wrong.

0 comments on commit db80dc7

Please sign in to comment.