Browse Source

Merge pull request #53 from longsleep/styles-made-seperate

Styles made seperate
pull/55/head
Simon Eisenmann 11 years ago
parent
commit
44106b2f3b
  1. 3
      .gitignore
  2. 39
      Dockerfile
  3. 36
      Makefile.am
  4. 39
      README.md
  5. 32
      configure.ac
  6. 36
      src/styles/Makefile.am
  7. 20
      static/css/bootstrap.min.css
  8. 23
      static/css/font-awesome.min.css
  9. 39
      static/css/main.min.css

3
.gitignore vendored

@ -8,9 +8,6 @@ @@ -8,9 +8,6 @@
/*.log
/changelog*.txt
/src/styles/.sass-cache
/static/css/main.min.css
/static/css/bootstrap.min.css
/static/css/font-awesome.min.css
/static/fonts/*
/static/js/main.min.js
/tokens.txt

39
Dockerfile

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
# Spreed WebRTC server.
#
# To execute it install docker and then run 'sudo docker build .'
#
FROM ubuntu:trusty
MAINTAINER Simon Eisenmann <simon@struktur.de>
# Set locale.
RUN locale-gen --no-purge en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV DEBIAN_FRONTEND noninteractive
# Base system
RUN apt-get update -q
# Base build dependencies.
RUN apt-get install -qy golang nodejs build-essential git mercurial automake autoconf
# Add and build Spreed WebRTC server.
ADD . /srv/spreed-webrtc
WORKDIR /srv/spreed-webrtc
RUN ./autogen.sh
RUN ./configure
RUN make pristine && make
# Create default config file.
RUN cp -v /srv/spreed-webrtc/server.conf.in /srv/spreed-webrtc/server.conf && \
sed -i 's|listen = 127.0.0.1:8080|listen = 0.0.0.0:8080|' /srv/spreed-webrtc/server.conf && \
sed -i 's|;root = .*|root = /srv/spreed-webrtc|' /srv/spreed-webrtc/server.conf
# Allow to mount.
VOLUME /srv/spreed-webrtc
# Tell about our service.
EXPOSE 8080
# Define entry point.
ENTRYPOINT ["/srv/spreed-webrtc/spreed-webrtc-server", "-c /srv/spreed-webrtc/server.conf"]

36
Makefile.am

@ -44,11 +44,6 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH) @@ -44,11 +44,6 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH)
DIST_SRC := $(DIST)/src
DIST_BIN := $(DIST)/bin
SASSFLAGS = --style=expanded
# Tools
AUTOPREFIXER_BROWSER_SUPPORT := "> 1%, last 2 versions, Firefox ESR, Opera 12.1"
all: build
build: get binary assets
@ -80,33 +75,27 @@ test: get @@ -80,33 +75,27 @@ test: get
GOPATH=$(GOPATH) $(GO) test -i $(TESTDEPS)
GOPATH=$(GOPATH) $(GO) test -v $(TESTDEPS)
assets: styles javascript
styles:
$(MKDIR_P) $(CURDIR)/static/css
$(MKDIR_P) $(CURDIR)/static/fonts
cp -r $(CURDIR)/src/styles/libs/font-awesome/fonts/font* $(CURDIR)/static/fonts
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/src/styles/main.scss:$(CURDIR)/static/css/main.min.css
$(AUTOPREFIXER) --browsers $(AUTOPREFIXER_BROWSER_SUPPORT) $(CURDIR)/static/css/main.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/src/styles/bootstrap.scss:$(CURDIR)/static/css/bootstrap.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/src/styles/font-awesome.scss:$(CURDIR)/static/css/font-awesome.min.css
styleshint:
$(FIND) src/styles -maxdepth 1 -name "*.scss" -print0 | xargs -0 -n1 $(SASS) --compass --scss $(SASSFLAGS) -c
assets: javascript fonts
releaseassets: RJSFLAGS = generateSourceMaps=false preserveLicenseComments=true
releaseassets: SASSFLAGS = --style=compressed --no-cache
releaseassets: dist_gopath assets
fonts:
$(MKDIR_P) $(CURDIR)/static/fonts
cp -r $(CURDIR)/src/styles/libs/font-awesome/fonts/font* $(CURDIR)/static/fonts
javascript:
$(MKDIR_P) $(OUTPUT_JS)
$(NODEJS) $(CURDIR)/build/r.js \
-o $(CURDIR)/build/build.js \
dir=$(OUTPUT_JS) $(RJSFLAGS)
styles: fonts
cd $(CURDIR)/src/styles && $(MAKE) styles
styleshint:
cd $(CURDIR)/src/styles && $(MAKE) styleshint
jshint:
@if [ "$(JSHINT)" = "" ]; then echo "Command 'jshint' not found"; exit 1; fi
$(FIND) static/ -wholename static/js/libs -prune -o -name "*.js" -print0 | xargs -0 -n1 $(JSHINT) --config .jshint
@ -148,7 +137,6 @@ install: @@ -148,7 +137,6 @@ install:
clean:
GOPATH=$(GOPATH) $(GO) clean -i $(PKG)
rm -rf $(CURDIR)/pkg
rm -rf $(CURDIR)/static/css
rm -rf $(CURDIR)/static/fonts
rm -rf $(CURDIR)/build/out
@ -178,4 +166,4 @@ tarball: distclean release install @@ -178,4 +166,4 @@ tarball: distclean release install
echo -n $(PACKAGE_VERSION) > $(TARPATH)/version.txt
tar czf $(DIST)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)_$(BUILD_OS)_$(BUILD_ARCH).tar.gz -C $(DIST) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
.PHONY: clean distclean pristine get getupdate build styles javascript release releasetest dist_gopath install gopath binary binaryrace binaryall tarball assets
.PHONY: clean distclean pristine get getupdate build javascript fonts styles release releasetest dist_gopath install gopath binary binaryrace binaryall tarball assets

39
README.md

@ -9,16 +9,17 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -9,16 +9,17 @@ The latest version of Spreed WebRTC can be found on GitHub:
## Build prerequisites
- [Go](http://golang.org) >= 1.1.0
- [NodeJS](http://nodejs.org/) >= 0.8.0
- [Sass](http://sass-lang.com/) >= 3.2.0
- [Compass](http://compass-style.org/)
- [Babel](http://babel.pocoo.org/)
- [po2json](https://github.com/mikeedwards/po2json)
- [autoprefixer](https://www.npmjs.org/package/autoprefixer) 1.1
- [NodeJS](http://nodejs.org/) >= 0.6.0
- [autoconf](http://www.gnu.org/software/autoconf/)
- [automake](http://www.gnu.org/software/automake/)
## Runtime dependencies
Spreed WebRTC compiles directly to native code and has no
external runtime dependencies. See http://golang.org/doc/faq#How_is_the_run_time_support_implemented for details.
## Building
[![Build Status](https://travis-ci.org/strukturag/spreed-webrtc.png?branch=master)](https://travis-ci.org/strukturag/spreed-webrtc)
@ -42,8 +43,7 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -42,8 +43,7 @@ The latest version of Spreed WebRTC can be found on GitHub:
Get Go external dependencies first with ``make get``.
```bash
$ make styles
$ make javascript
$ make assets
$ make binary
```
@ -72,7 +72,24 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -72,7 +72,24 @@ The latest version of Spreed WebRTC can be found on GitHub:
web client will launch.
## In place start for development
## Development
To build styles and translations, further dependencies are required.
The source tree contains already built styles and translations, so
these are only required if you want to make changes.
- [NodeJS](http://nodejs.org/) >= 0.10.0
- [Sass](http://sass-lang.com/) >= 3.2.0
- [Compass](http://compass-style.org/)
- [autoprefixer](https://www.npmjs.org/package/autoprefixer) 1.1
- [Babel](http://babel.pocoo.org/)
- [po2json](https://github.com/mikeedwards/po2json)
Styles can be found in src/styles. Translations are found in src/i18n.
Each folder has its own Makefile to build the corresponding files.
## Running server for development
Copy the server.conf.in to server.conf.
@ -99,7 +116,7 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -99,7 +116,7 @@ The latest version of Spreed WebRTC can be found on GitHub:
colors.
## Production use
## Running for production
Spreed WebRTC should be run through a SSL frontend proxy with
support for Websockets. Example configuration for Nginx can be
@ -118,7 +135,7 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -118,7 +135,7 @@ The latest version of Spreed WebRTC can be found on GitHub:
1. "Fork".
2. Make a feature branch.
3. Make changes.
4. Do your commits (run ``make fmt`` before commit).
4. Do your commits (run ``make fmt`` and ``make jshint`` before commit).
5. Send "pull request".

32
configure.ac

@ -25,7 +25,8 @@ AC_INIT([spreed-webrtc],[unknown],[opensource@struktur.de],[],[https://github.co @@ -25,7 +25,8 @@ AC_INIT([spreed-webrtc],[unknown],[opensource@struktur.de],[],[https://github.co
# minimum required versions
GO_VERSION_MIN=1.1
NODEJS_VERSION_MIN=0.8.0
NODEJS_VERSION_MIN=0.6.0
NODEJS_VERSION_STYLES_MIN=0.10.0
SASS_VERSION_MIN=3.2.0
AC_CONFIG_SRCDIR([src/app/spreed-webrtc-server/main.go])
@ -68,24 +69,30 @@ AC_SUBST(GO) @@ -68,24 +69,30 @@ AC_SUBST(GO)
AC_PATH_PROGS([NODEJS],[nodejs node])
if test x"${NODEJS}" == x"" ; then
AC_MSG_ERROR([Please install node.js before trying to build spreed-webrtc.])
else
NODEJS_VERSION=`$NODEJS --version | $SED 's/^v//'`
AX_COMPARE_VERSION([$NODEJS_VERSION], [lt], [$NODEJS_VERSION_MIN],
[AC_MSG_ERROR([Please install node.js $NODEJS_VERSION_MIN or newer before trying to build spreed-webrtc (found node.js $NODEJS_VERSION).])])
AX_COMPARE_VERSION([$NODEJS_VERSION], [lt], [$NODEJS_VERSION_STYLES_MIN],
[AC_MSG_WARN([Please install node.js NODEJS_VERSION_STYLES_MIN or newer before trying to build styles (found node.js $NODEJS_VERSION).])])
fi
NODEJS_VERSION=`$NODEJS --version | $SED 's/^v//'`
AX_COMPARE_VERSION([$NODEJS_VERSION], [lt], [$NODEJS_VERSION_MIN],
[AC_MSG_ERROR([Please install node.js $NODEJS_VERSION_MIN or newer before trying to build spreed-webrtc (found node.js $NODEJS_VERSION).])])
AC_SUBST(NODEJS)
AC_PATH_PROGS([SASS],[sass])
if test x"${SASS}" == x"" ; then
AC_MSG_ERROR([Please install sass before trying to build spreed-webrtc.])
AC_MSG_WARN([Please install sass before trying to build spreed-webrtc.])
SASS=sass
else
SASS_VERSION=`$SASS --version | $SED 's/^Sass //' | $SED 's/ .*//'`
AX_COMPARE_VERSION([$SASS_VERSION], [lt], [$SASS_VERSION_MIN],
[AC_MSG_WARN([Please install sass $SASS_VERSION_MIN or newer before trying to build styles (found sass $SASS_VERSION).])])
fi
SASS_VERSION=`$SASS --version | $SED 's/^Sass //' | $SED 's/ .*//'`
AX_COMPARE_VERSION([$SASS_VERSION], [lt], [$SASS_VERSION_MIN],
[AC_MSG_ERROR([Please install sass $SASS_VERSION_MIN or newer before trying to build spreed-webrtc (found sass $SASS_VERSION).])])
AC_SUBST(SASS)
AC_PATH_PROGS([COMPASS],[compass])
if test x"${COMPASS}" == x"" ; then
AC_MSG_ERROR([Please install compass before trying to build spreed-webrtc.])
AC_MSG_WARN([Please install compass before trying to build styles.])
COMPASS=compass
fi
AC_SUBST(COMPASS)
@ -96,13 +103,14 @@ sass_compass=$? @@ -96,13 +103,14 @@ sass_compass=$?
rm $tempfile
if test x"${sass_compass}" != x"0" ; then
AC_MSG_RESULT([not available])
AC_MSG_ERROR([Please install compass so it can be used using "sass --compass ...".])
AC_MSG_WARN([Please install compass so it can be used using "sass --compass ...".])
fi
AC_MSG_RESULT([ok])
AC_PATH_PROGS([AUTOPREFIXER],[autoprefixer])
if test x"${AUTOPREFIXER}" == x"" ; then
AC_MSG_ERROR([Please install autoprefixer before trying to build spreed-webrtc.])
AC_MSG_WARN([Please install autoprefixer before trying to build styles.])
AUTOPREFIXER=autoprefixer
fi
AC_SUBST(AUTOPREFIXER)
@ -114,6 +122,6 @@ AC_DEFINE_UNQUOTED(PACKAGE_VERSION, ["$PACKAGE_VERSION"], [Define to the version @@ -114,6 +122,6 @@ AC_DEFINE_UNQUOTED(PACKAGE_VERSION, ["$PACKAGE_VERSION"], [Define to the version
AC_DEFINE_UNQUOTED(PACKAGE_STRING, ["$PACKAGE_STRING"], [Define to the full name and version of this package.])
AC_CONFIG_FILES([
Makefile
Makefile src/styles/Makefile
])
AC_OUTPUT

36
src/styles/Makefile.am

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
#
# Spreed WebRTC.
# Copyright (C) 2013-2014 struktur AG
#
# This file is part of Spreed WebRTC.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
SASSFLAGS = --style=compressed --no-cache
AUTOPREFIXER_BROWSER_SUPPORT := "> 1%, last 2 versions, Firefox ESR, Opera 12.1"
STATIC = ../../static
styles:
$(MKDIR_P) $(STATIC)/css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/main.scss:$(STATIC)/css/main.min.css
$(AUTOPREFIXER) --browsers $(AUTOPREFIXER_BROWSER_SUPPORT) $(STATIC)/css/main.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/bootstrap.scss:$(STATIC)/css/bootstrap.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/font-awesome.scss:$(STATIC)/css/font-awesome.min.css
styleshint:
$(FIND) ./ -maxdepth 1 -name "*.scss" -print0 | xargs -0 -n1 $(SASS) --compass --scss $(SASSFLAGS) -c

20
static/css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

23
static/css/font-awesome.min.css vendored

File diff suppressed because one or more lines are too long

39
static/css/main.min.css vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save